PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Printing a report created with the report editor
  • Printing a report in PDF format
  • Notes
  • Examples
  • Printing a programmed print
  • Printing a WLanguage print in PDF format
  • Notes
  • Examples
  • Printing a PDF from the print preview
  • Principle
  • "Before re-printing the report" process
  • Notes and limitations
  • Notes
  • General advice
  • Availability of controls in the reports
  • Control in RTF format
  • Image control
  • PDF in report background
  • Print in PDF/A-1b format
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
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to create a PDF file during a print.
This PDF file can be created:
  • WINDEVWEBDEV - Server codeiPhone/iPadUniversal Windows 10 App from a report created in the report editor.
  • from a print performed with the WLanguage functions.
  • WINDEVReports and Queries by the end user via the print preview.
AndroidAndroid Widget iPhone/iPadUniversal Windows 10 AppJava Notes:
  • AndroidAndroid Widget Java Only the prints performed by programming and in PDF format are available. No print can be performed via the report editor.
  • iPhone/iPadUniversal Windows 10 App Only the prints in PDF format are available (report print or print performed by programming).
WINDEVWEBDEV - Server codeiPhone/iPadUniversal Windows 10 App
Printing a report created with the report editor

Printing a report in PDF format

To print a report in PDF format:
  1. Create the requested report in the report editor.
  2. In the print process of the report in PDF format:
    • Configure the options for printing in PDF format with iParameterPDF. You can define:
      • the password used to open the file.
      • the options for compressing images.
      • the options for the presence of bookmarks.
      • the options for protecting the PDF file. You also have the ability to define the password used to modify these protection options.
      • the use of the Unicode format.
      • Versions 21 and later
        WINDEVWEBDEV - Server code the use of the PDF/A format (the generated version is PDF/A-1b).
        New in version 21
        WINDEVWEBDEV - Server code the use of the PDF/A format (the generated version is PDF/A-1b).
        WINDEVWEBDEV - Server code the use of the PDF/A format (the generated version is PDF/A-1b).
    • Define the report destination with iDestination. In this case, the report must be printed in PDF format (iPDF or iGenericPDF constant).
    • Start printing the report in PDF format with iPrintReport.

Notes

  • The order in which iDestination and iParameterPDF are used is not important.
  • Versions 21 and later
    WINDEVWEBDEV - Server code You have the ability to sign the generated PDF file via the Signature control.
    New in version 21
    WINDEVWEBDEV - Server code You have the ability to sign the generated PDF file via the Signature control.
    WINDEVWEBDEV - Server code You have the ability to sign the generated PDF file via the Signature control.
  • Versions 21 and later
    WINDEVWEBDEV - Server code If the report must be printed in PDF/A format, you have the ability to enable the GUI errors specific to this format:
    1. Display the description window of report ("Report description" from the popup menu).
    2. In the the "Options" tab, check "Enable the errors specific to the PDF/A-1b export".
    3. Validate the description window of the report and save the report. The errors are displayed in the "Compilation errors" pane.
    New in version 21
    WINDEVWEBDEV - Server code If the report must be printed in PDF/A format, you have the ability to enable the GUI errors specific to this format:
    1. Display the description window of report ("Report description" from the popup menu).
    2. In the the "Options" tab, check "Enable the errors specific to the PDF/A-1b export".
    3. Validate the description window of the report and save the report. The errors are displayed in the "Compilation errors" pane.
    WINDEVWEBDEV - Server code If the report must be printed in PDF/A format, you have the ability to enable the GUI errors specific to this format:
    1. Display the description window of report ("Report description" from the popup menu).
    2. In the the "Options" tab, check "Enable the errors specific to the PDF/A-1b export".
    3. Validate the description window of the report and save the report. The errors are displayed in the "Compilation errors" pane.
  • Versions 18 and later
    iPhone/iPad If necessary, the created PDF file can be printed from the device by iPrintPDF. This function allows you to use the native system window to configure the file print.
    New in version 18
    iPhone/iPad If necessary, the created PDF file can be printed from the device by iPrintPDF. This function allows you to use the native system window to configure the file print.
    iPhone/iPad If necessary, the created PDF file can be printed from the device by iPrintPDF. This function allows you to use the native system window to configure the file print.
  • {special:platform:IPHONE,UNIVERSALAPP|The generated PDF file can be directly opened by ShellExecute.

Examples

iDestination(iPDF)
iPrintReport(RPT_MyPDFReport)
iDestination(iPDF)
// Protect the PDF against printing
// and against selection and copy/paste
// No password for opening the PDF file
// Password for modifying the protection settings
iParameterPDF(iProtectionPrinting, iProtectionSelection, "", "Protection")
// Print the report
iPrintReport(RPT_MyPDFReport)
Printing a programmed print

Printing a WLanguage print in PDF format

To perform a WLanguage print in PDF format:
  1. Define the destination of the print and the parameters of the PDF file to generate with:
    • iDestination to define the print in PDF format (iPDF or iGenericPDF constant).
    • iParameterPDF to configure the options for printing in PDF format. You can define:
      • the password used to open the file.
      • the options for compressing images.
      • the options for the presence of bookmarks.
      • the options for protecting the PDF file. You also have the ability to define the password used to modify these protection options.
      • Versions 21 and later
        WINDEVWEBDEV - Server code the use of the PDF/A format (the generated version is PDF/A-1b).
        New in version 21
        WINDEVWEBDEV - Server code the use of the PDF/A format (the generated version is PDF/A-1b).
        WINDEVWEBDEV - Server code the use of the PDF/A format (the generated version is PDF/A-1b).
  2. Use the print functions to define the content of the print.
  3. Start the print with iEndPrinting.

Notes

  • The order in which iDestination and iParameterPDF are used is not important.
  • Versions 21 and later
    WINDEVWEBDEV - Server code You have the ability to sign the generated PDF file with iPrintSignature. This function must be used at the same time as the print functions.
    New in version 21
    WINDEVWEBDEV - Server code You have the ability to sign the generated PDF file with iPrintSignature. This function must be used at the same time as the print functions.
    WINDEVWEBDEV - Server code You have the ability to sign the generated PDF file with iPrintSignature. This function must be used at the same time as the print functions.
  • Versions 18 and later
    AndroidAndroid Widget iPhone/iPad If necessary, the created PDF file can be printed from the device by iPrintPDF.
    • iPhone/iPad This function allows you to use the native system window to configure the file print.
    • AndroidAndroid Widget This function allows you to print the file by using the Cloud Print service of Google.
    New in version 18
    AndroidAndroid Widget iPhone/iPad If necessary, the created PDF file can be printed from the device by iPrintPDF.
    • iPhone/iPad This function allows you to use the native system window to configure the file print.
    • AndroidAndroid Widget This function allows you to print the file by using the Cloud Print service of Google.
    AndroidAndroid Widget iPhone/iPad If necessary, the created PDF file can be printed from the device by iPrintPDF.
    • iPhone/iPad This function allows you to use the native system window to configure the file print.
    • AndroidAndroid Widget This function allows you to print the file by using the Cloud Print service of Google.
  • AndroidAndroid Widget iPhone/iPadUniversal Windows 10 App The generated PDF file can be directly opened by ShellExecute.
  • AndroidAndroid Widget The PDF prints support the standard Adobe fonts only (no Unicode format): Courrier, Helvetica, Times, Symbol and ZapFDingbats.

Examples

// Create the PDF file
iDestination(iPDF, "C:\Temp\MyPDF.PDF")
// Print code
iCreateFont(1, 16, iBold, iRoman)
//Call to procedures used to print the content
PrintTitle()
PrintText()
// End of print and close the created PDF file
iEndPrinting()
WINDEVWEBDEV - Server code
// Protect the PDF against printing
// and against selection and copy/paste
// No password for opening the PDF file
// Password for modifying the protection settings
iParameterPDF(iProtectionPrinting, iProtectionSelection, "", "Protection")
// Create the PDF file
iDestination(iPDF, "C:\Temp\MyPDF.PDF")
// Print code
iCreateFont(1, 16, iBold, iRoman)
//Call to procedures used to print the content
PrintTitle()
PrintText()
// End of print and close the created PDF file
iEndPrinting()
WINDEVReports and Queries
Printing a PDF from the print preview

Principle

In the WINDEV applications, the end user can choose the print mode from the print preview. He can choose to print in PDF format if the "PDF" option is available in the "Export" pane of the print preview.
In this case, the options defined by iParameterPDF are automatically taken into account.
Versions 21 and later

"Before re-printing the report" process

The "Before re-printing the report" process is used to find out the print mode selected by the user. In this process, you have the ability to configure the options for generating the PDF according to the choices performed by the user.
Example: During the print via the print preview, the following code opens a window asking for the password of the PDF file to generate:
// -- "Before re-printing the report" process
IF iDestination = iPDF THEN
sPassword is string = Open(WIN_PDFSetting)
iParameterPDF(sPassword)
END
New in version 21

"Before re-printing the report" process

The "Before re-printing the report" process is used to find out the print mode selected by the user. In this process, you have the ability to configure the options for generating the PDF according to the choices performed by the user.
Example: During the print via the print preview, the following code opens a window asking for the password of the PDF file to generate:
// -- "Before re-printing the report" process
IF iDestination = iPDF THEN
sPassword is string = Open(WIN_PDFSetting)
iParameterPDF(sPassword)
END

"Before re-printing the report" process

The "Before re-printing the report" process is used to find out the print mode selected by the user. In this process, you have the ability to configure the options for generating the PDF according to the choices performed by the user.
Example: During the print via the print preview, the following code opens a window asking for the password of the PDF file to generate:
// -- "Before re-printing the report" process
IF iDestination = iPDF THEN
sPassword is string = Open(WIN_PDFSetting)
iParameterPDF(sPassword)
END
Notes and limitations

Notes

General advice

For a better rendering, use TrueType or OpenType fonts.
Caution: the OpenType fonts are not incorporated in the generated PDF. These fonts must be installed on the user computer to get a correct rendering.

Availability of controls in the reports

The following controls are not available:
  • LinuxiPhone/iPadUniversal Windows 10 App RTF control
  • iPhone/iPadUniversal Windows 10 App Edit control
  • LinuxiPhone/iPadUniversal Windows 10 App Signature control
  • iPhone/iPadUniversal Windows 10 App Organizer control
  • iPhone/iPadUniversal Windows 10 App Scheduler control
  • LinuxiPhone/iPadUniversal Windows 10 App Gantt Chart control
  • LinuxiPhone/iPadUniversal Windows 10 App Pivot Table control
  • iPhone/iPadUniversal Windows 10 App Spreadsheet control
  • LinuxiPhone/iPadUniversal Windows 10 App HTML control
  • Chart control: Only the Chart controls created from version 17 are available.

Control in RTF format

General limitations:
  • The static control in RTF format may be truncated during a page break.
  • The arrays found in an RTF control are not printed.
  • The images used in the RTF controls are not printed.
Versions 17 and later
iParameter associated with the "RTFWINDOWS=NO" parameter or with the iRTFWithImagesAndTables constant is used to properly print the tables and images found in the RTF controls.
New in version 17
iParameter associated with the "RTFWINDOWS=NO" parameter or with the iRTFWithImagesAndTables constant is used to properly print the tables and images found in the RTF controls.
iParameter associated with the "RTFWINDOWS=NO" parameter or with the iRTFWithImagesAndTables constant is used to properly print the tables and images found in the RTF controls.
LinuxiPhone/iPadUniversal Windows 10 App The RTF controls and the RTF options are not available.

Image control

  • A white margin appears if the image does not occupy the entire control in "homothetic image" mode.
  • The transparency of images is ignored. The image is printed on a white background.
LinuxiPhone/iPadUniversal Windows 10 App

PDF in report background

A PDF cannot be used in background image of the report.
Versions 21 and later
WINDEVWEBDEV - Server code

Print in PDF/A-1b format

  • The transparency of images is not supported:
    • If the image contains a transparent background in its format, the image will be drawn on a white background.
    • If the "Transparent magenta" color is used, the image rendering may differ in the generated PDF.
  • The "Opentype" fonts are not supported because the "Opentype" fonts cannot be incorporated in the generated PDF.
  • All the fonts use must be incorporated in the generated PDF and they must contain all the displayed characters.
    • In Windows, if characters are missing, the substitution font used is "Arial Unicode ms".
    • In Linux, if characters are missing, an error is displayed.
Tip: How to find out whether the print in PDF/1-1b format is correct?
  • If the print is performed from a report, you have the ability to enable the GUI errors specific to this format ("Options" tab in the description window of the report, "Enable the errors specific to the PDF/A-1b export" option).
  • During a dynamic audit, the errors specific to the PDF/A-1b management are detected and displayed.
New in version 21
WINDEVWEBDEV - Server code

Print in PDF/A-1b format

  • The transparency of images is not supported:
    • If the image contains a transparent background in its format, the image will be drawn on a white background.
    • If the "Transparent magenta" color is used, the image rendering may differ in the generated PDF.
  • The "Opentype" fonts are not supported because the "Opentype" fonts cannot be incorporated in the generated PDF.
  • All the fonts use must be incorporated in the generated PDF and they must contain all the displayed characters.
    • In Windows, if characters are missing, the substitution font used is "Arial Unicode ms".
    • In Linux, if characters are missing, an error is displayed.
Tip: How to find out whether the print in PDF/1-1b format is correct?
  • If the print is performed from a report, you have the ability to enable the GUI errors specific to this format ("Options" tab in the description window of the report, "Enable the errors specific to the PDF/A-1b export" option).
  • During a dynamic audit, the errors specific to the PDF/A-1b management are detected and displayed.
WINDEVWEBDEV - Server code

Print in PDF/A-1b format

  • The transparency of images is not supported:
    • If the image contains a transparent background in its format, the image will be drawn on a white background.
    • If the "Transparent magenta" color is used, the image rendering may differ in the generated PDF.
  • The "Opentype" fonts are not supported because the "Opentype" fonts cannot be incorporated in the generated PDF.
  • All the fonts use must be incorporated in the generated PDF and they must contain all the displayed characters.
    • In Windows, if characters are missing, the substitution font used is "Arial Unicode ms".
    • In Linux, if characters are missing, an error is displayed.
Tip: How to find out whether the print in PDF/1-1b format is correct?
  • If the print is performed from a report, you have the ability to enable the GUI errors specific to this format ("Options" tab in the description window of the report, "Enable the errors specific to the PDF/A-1b export" option).
  • During a dynamic audit, the errors specific to the PDF/A-1b management are detected and displayed.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment