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
  • Printing a justified RTF text
  • Printing RTF with page breaks
  • Printing RTF
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, iPrintZoneRTF is kept for backward compatibility. This function has been replaced with iPrintAreaRTF.
Prints rich text format (RTF) in a rectangular area. The print job is not started (only iEndPrinting can be used to start the print job).
iPrintAreaRTF(TexteRTF, 0, 0, dHauteur, 200)
Syntax
<Result> = iPrintAreaRTF(<RTF text> , <X1> , <Y1> , <X2> , <Y2> [, <Start> [, <End>]])
<Result>: Integer
Index of the last RTF element printed in the rectangular area (WINDEV/WEBDEV specific count).
<RTF text>: Character string
RTF string that will be printed in a specific area.
<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 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
Index of the 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 iPrintAreaRTF while keeping its justification, iParameter must be previously used as follows:
iParameter("JustificationRTF=Oui")
If the parameters used to divide RTF text are used (<Start> and <End>), the text justification text will be stored.

Printing RTF with page breaks

The following code prints RTF containing programmed page breaks:
// Affiche le visualisateur de rapports
iDestination(iViewer)
// Conversion du texte
sTexte is string = RTFVersTexte(SAI_SaisieTexte)
// Taille du texte
nTailleTexte is int = Taille(sTexte)
// Suppression du nombre de sauts de page à la taille du texte
nTailleTexte -= StringCount(sTexte, Charact(12))
// Le RC doit correspondre à un seul caractères
nTailleTexte -= StringCount(sTexte, Charact(13))

// Boucle sur toutes les pages
nDébut is int
nTaille is int = -1
LOOP
	// Imprime la page
	nDébut = nTaille + 1
	nTaille = iPrintAreaRTF(SAI_SaisieTexte, 0, 0, iPageWidth(), iPageHeight(), nDébut, -1)
	// Saute la page si il reste des pages
	IF nTaille < nTailleTexte AND nTaille > nDébut THEN 
		iSkipPage()
	END
TO DO WHILE nTaille < nTailleTexte AND nTaille > nDébut 
// Fin de l'impression
iEndPrinting()

Printing RTF

To use iPrintAreaRTF, the "RICHED20.DLL" file must be on the current computer.
In most cases, the "RICHED20.DLL" file is in the Windows system directory.
Component: wd300prn.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help