PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Printing a justified RTF text
  • Printing an RTF text containing page breaks
  • Printing a RTF text
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Prints a text in RTF format in a rectangular area. The print is not started (only iEndPrinting can be used to start the print).
iPrintZoneRTF(RTFText, 0, 0, dHeight, 200)
Syntax
<Result> = iPrintZoneRTF(<RTF Text> , <X1> , <Y1> , <X2> , <Y2> [, <Start> [, <End>]])
<Result>: Integer
Number of characters printed in the rectangular area. If the entire text was printed, <Result> corresponds to the size of <RTF Text>.
<RTF Text>: Character string
Character string in RTF format that will be printed in a specific area.
<X1>: Real
Horizontal coordinate of top left corner of the print area (in millimeters).
Value included between 0 and the page width (returned by iPageWidth).
<Y1>: Real
Vertical coordinate of top left corner of the print area (in millimeters).
Value included between 0 and the page height (returned by iPageHeight).
<X2>: Real
Horizontal coordinate of bottom right corner of the print area (in millimeters).
Value included between 0 and the page width (returned by iPageWidth).
<Y2>: Real
Vertical coordinate of bottom right corner of the print area (in millimeters).
Value included between 0 and the page height (returned by iPageHeight).
<Start>: Optional integer
Subscript of first character in the <RTF Text> to print. If this parameter is not specified, the <RTF Text> is printed from the first character.
<End>: Optional integer
Subscript of last character in the <RTF Text> to print. If this parameter is not specified, the <RTF Text> is printed up to the last character.
Remarks

Printing a justified RTF text

To print a text with iPrintZoneRTF while keeping its justification, iParameter must be previously used as follows:
iParameter("RTFJustification=Yes")
If the parameters used to divide the RTF text are used (<Beginning> and <End>), the text justification text will be stored.

Printing an RTF text containing page breaks

The following code prints a RTF text containing programmed page breaks:
// Displays the preview window
iPreview()
// Convert the text
sText is string = RTFToText(EDT_EditText)
// Size of the text
nTextSize is int = Length(sText)
// Delete the number of page breaks to the size of the text
nTextSize -= StringCount(sText, Charact(12))
// Loop on all the pages
nStart is int
nSize is int = -1
LOOP
// Prints the page
nStart = nSize + 1
nSize = iPrintZoneRTF(EDT_EditText, 0, 0, iPageWidth(), iPageHeight(), nStart, -1)
// Skips the page if other pages are found
IF nSize < nTextSize AND nSize > nStart THEN
iSkipPage()
END
TO DO WHILE nSize < nTextSize AND nSize > nStart
// End of print
iEndPrinting()

Printing a RTF text

In order for iPrintZoneRTF to operate, "RICHED20.DLL" must be found on the current computer.
In most cases, the "RICHED20.DLL" file is found in the system directory of Windows.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230prn.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment