ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Print functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Warning
From version 28, iPrintZoneHTML is kept for backward compatibility. This function has been replaced with iPrintAreaHTML.
Pritns a text in HTML format in a rectangular area. The print job is not started (only iEndPrinting can be used to start the print job).
Example
iDestination(iPage)

// Récupération de la hauteur de la zone
dHauteur is real
dHauteur = iAreaHeight(sTexteHTML, 100, iHTML)

// Trace un cadre
iBorder(0,0, 200, dHauteur*2)

// Impression du HTML dans le cadre
iPrintAreaHTML(sTexteHTML, 0, 0, 200, dHauteur*2)

iEndPrinting()
// Impression de HTML sur plusieurs pages
PROCEDURE ImprimeZoneHTMLMultiPage(LOCAL sHTMLàImprimerEnUTF8 is string ANSI,
	LOCAL x1 is real = 0,LOCAL y1 is real = iYPos(), 
	LOCAL x2 is real = iPageWidth() - x1)
// Variables de travail
nElémentDébut is int = 0
nElémentFin is int = 0
rHauteurRestante is real = 0
rDernièreHauteurImprimée is real = 0

// Boucle pour imprimer tous les "éléments" du HTML
LOOP
	// Hauteur de ce qui reste à imprimer
	rHauteurRestante = iAreaHeight(sHTMLàImprimerEnUTF8, x2-x1, iHTML, nElémentDébut + 1)
	IF rHauteurRestante <= 0 THEN
		// Plus rien à imprimer
		// On positionne le "curseur d'impression" après ce qui a été imprimé
		iYPos(y1 + rDernièreHauteurImprimée)
		BREAK
	END
	// Mémorise la dernière hauteur imprimée
	rDernièreHauteurImprimée = rHauteurRestante
	// Si ce n'est pas le début, on saute à la page suivante
	IF nElémentDébut > 0 THEN 
		iSkipPage()
		// On repart donc en haut de la page
		y1 = 0
	END
	// Imprime effectivement tout ce qui rentre dans la zone
	nElémentFin = iPrintAreaHTML(sHTMLàImprimerEnUTF8, x1, y1, ...
		x2, iPageHeight(), nElémentDébut + 1)
	// On continue à partir de l'élément suivant
	nElémentDébut = nElémentFin
END
Syntax
<Result> = iPrintAreaHTML(<HTML text> , <X1> , <Y1> , <X2> , <Y2> [, <Start> [, <End>]])
<Result>: Integer
Index of the last HTML element printed in the rectangular area (WINDEV/WEBDEV specific count).
<HTML text>: Character string
Character string in HTML format that must be printed in a specific area. This string must be encoded using UTF-8. If necessary, use StringToUTF8 to perform the conversion.
<X1>: Real
Horizontal coordinate of the upper-left corner of the print area (in millimeters).
Value between 0 and the page width (returned by iPageWidth).
<Y1>: Real
Vertical coordinate of the upper-left corner of the print area (in millimeters).
Value between 0 and the page height (returned by iPageHeight).
<X2>: Real
Horizontal coordinate of the lower-right corner of the print area (in millimeters).
Value between 0 and the page width (returned by iPageWidth).
<Y2>: Real
Vertical coordinate of the lower-right corner of the print area (in millimeters).
Value between 0 and the page height (returned by iPageHeight).
<Start>: Optional integer
Index of the first HTML element found in the <HTML text> to print. If this parameter is not specified, the <HTML text> is printed from the first HTML element.
<End>: Optional integer
Index of the last HTML element found in the <HTML text> to print. If this parameter is not specified, the <HTML text> is printed until the last HTML element.
Component: wd300prn.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help