ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Print functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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)
 
// Retrieve the height of the area
dHeight is real
dHeight = iAreaHeight(sHTMLText, 100, iHTML)
 
// Draws a border
iBorder(0,0, 200, dHeight*2)
 
// Print the HTML text inside the border
iPrintAreaHTML(sHTMLText, 0, 0, 200, dHeight*2)
 
iEndPrinting()
// Print HTML on multiple pages
PROCEDURE PrintAreaHTMLMultiPage(LOCAL sHTMLToPrintToUTF8 is ANSI string,
LOCAL x1 is real = 0,LOCAL y1 is real = iPosY(),
LOCAL x2 is real = iLargeurPage() - x1)
// Working variables
nElementBeginning is int = 0
nElementEnd is int = 0
rRemainingHeight is real = 0
rLastHeightPrinted is real = 0
 
// Loop to print all the HTML "elements"
LOOP
// Height of what remains to be printed
rRemainingHeight = iAreaHeight(sHTMLToPrintToUTF8, x2-x1, iHTML, nElementBeginning + 1)
IF rRemainingHeight <= 0 THEN
// Nothing else to print
// Position the "print cursor" after the last printed element
iPosY(y1 + rLastHeightPrinted)
BREAK
END
// Stores the last printed height
rLastHeightPrinted = rRemainingHeight
// If it's not the beginning, skip to the next page
IF nElementBeginning > 0 THEN
iSkipPage()
// Start at the top of the page
y1 = 0
END
// Prints everything inside the give area
nElementEnd is int = iPrintAreaHTML(sHTMLToPrintToUTF8, x1, y1, ...
x2, iPageHeight(), nElementBeginning + 1)
// Continue from the following element
nElementBeginning = nElementEnd
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: 06/21/2023

Send a report | Local help