PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

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
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
iPreview(iPage)
 
// Retrieve the height of the area
dHeight is real
dHeight = iZoneHeight(sHTMLText, 100, iHTML)
 
// Draws a border
iBorder(0,0, 200, dHeight*2)
 
// Print the HTML text inside the border
iPrintZoneHTML(sHTMLText, 0, 0, 200, dHeight*2)
 
iEndPrinting()
// Print HTML on multiple pages
PROCEDURE PrintZoneHTMLMultiPage(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 = iZoneHeight(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 = iPrintZoneHTML(sHTMLToPrintToUTF8, x1, y1, ...
x2, iPageHeight(), nElementBeginning + 1)
// Continue from the following element
nElementBeginning = nElementEnd
END
Syntax
<Result> = iPrintZoneHTML(<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 included 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 included 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 included 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 included between 0 and the page height (returned by iPageHeight).
<Start>: Optional integer
Subscript 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
Subscript 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: wd270prn.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment