ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing for Linux
  • Overview
  • Required configuration
  • How to directly open the PDF generated during a print job?
  • Printing reports to PDF in Linux
  • Limitations: reports controls supported in Linux
  • Printing in WLanguage in Linux
  • Step 1: Configuring the print parameters
  • Step 2: Creating print fonts
  • Step 3: Printing characters, images
  • Step 4: Starting the print job
  • List of print functions available in Linux
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
Overview
WEBDEV and WINDEV allow you to print to PDF in Linux using WLanguage functions. You can:
  • print to PDF in WLanguage.
  • print reports as PDF documents using the report viewer.
Print jobs with WLanguage functions are just like standard print jobs.
This help page presents the limitations that come with printing in Linux.

Required configuration

To use the print features in WEBDEV Linux, you must install:
  • the QT library (Core and GUI), version 5 or later.
    In Ubuntu, the QT library can be installed with the following commands:
    sudo apt-get install libqtcore5
    sudo apt-get install libqtgui5
  • the LibFreeType.so library (32 or 64-bit), version 6 or later.
    Caution: The PC SOFT framework searches for the libfreetype.so library. If only the libfreetype.so.6 file exists, you must create a symbolic link via the following command:
    ln -s /usr/lib/libfreetype.so.6 /usr/lib/libfreetype.so
Remark: You can install Microsoft fonts in Linux to make reports look similar to Windows. In Ubuntu, these fonts can be added by following this procedure: http://doc.ubuntu-fr.org/msttcorefonts.
Remark: The following Linux distributions are supported:
  • Debian 5.02
  • Ubuntu 10.04

How to directly open the PDF generated during a print job?

To directly open the PDF document created for the print job, use the following commands:
xdg-open url
or
gnome-open url
Printing reports to PDF in Linux
The different steps for printing reports in Linux are as follows:
  • Step 1: Configuring the print destination.
    This configuration is defined with iDestination. Only PDF printing is available in Linux. iDestination must be used with the PDF file generation constants (iPDF or iGenericPDF).
  • Step 2: Starting the print job.
    The report is printed by iPrintReport.

Limitations: reports controls supported in Linux

The following controls are supported in a report printed in Linux:
  • Static control (RTF is not supported).
  • Calculated control.
  • Image control.
  • Preset control.
  • Shape control.
  • Internal Report control.
  • Link control.
  • Edit control.
  • Bar Code control.
  • Chart control.
  • Check Box control.
  • Organizer control.
  • Scheduler control.
  • Spreadsheet control.
The following controls are not supported:
  • RTF Static control.
  • Pivot Table control.
  • Gantt Chart control.
  • Signature control.
  • HTML Static control.
Printing in WLanguage in Linux
The steps for printing in WLanguage as are follows:

Step 1: Configuring the print parameters

This step is used to choose the print parameters for the document (quality, orientation).
This step is optional.
The different operations are as follows:
  1. Selecting the parameters for printing the document (iParameter). When printing in Linux, you have the ability to only configure the format of the page or its orientation.
  2. Re-defining the print margins (iMargin). The top, bottom, left and right margins can be modified. If this function is not called, the default margins (differ according to the selected printer) will be used.
Caution: The order of above-mentioned operations must be respected. If a print is in progress, iParameter cancels the current print.

Step 2: Creating print fonts

This step allows you to define and choose the different fonts that will be used in the printed document.
You can only choose fonts specific to a print job: these fonts can only be used when printing with WLanguage functions.
This step is optional.
The default font is used if no font is specified for the print job.
  • Font: Don't care
  • Font 0,
  • size: 12 pica,
  • normal style.
  • color: black
The print fonts are created by iCreateFont.
Remarks:
  • Only the TrueType fonts (*.ttf) can be used in Linux.
  • If fonts other than basic fonts must be used, they must be installed on the WEBDEV server (by using the directories of the distribution used). For more details, see the documentation of the distribution used.

Step 3: Printing characters, images

This step consists in "sending the different elements to print to the printer":
  • text,
  • images,
  • drawings, ...
The PDF print job (configured with iDestination) will only be started when iEndPrinting is called.
Several WLanguage functions allow you to print text, images, etc. See the list of print functions that can be used in Linux for more details.
Remark: Printing images: JPEG, BMP, PNG and GIF images can be printed in Linux.

Step 4: Starting the print job

This step consists in starting the print job (iEndPrinting).
List of print functions available in Linux
The following print functions are available in Linux:
iAreaHeightCalculates the height of a fixed-width area required to print the entire text that uses the current font.
iBorderPrints a border at specified coordinates.
iChangeSubReportSourceModifies through programming the report associated with a sub-report in a composite report.
iCloseReportStops printing the current report immediately.
iColumnEndForces a column break in a multi-column report.
iColumnNumReturns the number of the current column in a multi-column report.
iConfigureReportConfigures the printer by opening the configuration window (WINDEV and WINDEV Mobile).
iCreateFontCreates a new print font.
iCurrentFileReturns the name of the file currently generated.
iDestinationConfigures the print destination.
iDidotFontSelects the unit that will be used for the height of the fonts (created by iCreateFont): DIDOT point or PICA point.
iDocumentCanceledUsed to find out whether the current print was canceled by the user.
iDocumentPrintedDetermines whether the user printed the document from the report viewer.
iEllipsePrints an ellipse (in a rectangle).
iEndPrintingSignals the end of the document to print and actually starts printing the data stored in the printer spooler via the following functions: iPrint, iPrintImage, iNewLine, etc.
iEndReportForces the report print to stop.
iEscapeSends an ESCAPE command or a data command to a printer.
iFontSelects the default font.
iForceComplementForces the printing of a Body Complement block.
iGroupAddAdds a report to a group of reports.
iGroupConfigureModifies the parameters of a report found in a group of reports.
iGroupPrintStarts printing a report found in a group of reports.
iHLinePrints a horizontal line at specified coordinates.
iImageHeightCalculates the height of the image to print (in millimeters).
iImageWidthCalculates the width of the image to print (in millimeters).
iInfoPrinterRetrieves the characteristics of the current or default printer.
iInitReportQueryInitializes the query linked to the report (for a query with parameters).
iInitReportQueryConnectionInitializes the query linked to the report.
iInitSubReportInitializes the parameters of a subreport of a composite report.
iLastFileReturns:
  • the full name of the last file generated during the print (PDF, RTF, text, ...).
  • the list of created duplicate files.
iLinePrints a line at specified coordinates.
iListNestedReportsReturns:
  • the list of nested reports currently printed (reports run by iPrintReport in one of the processes of the report currently printed).
  • the list of sequenced reports currently printed (iSequenceAdd).
iMarginDefines the "logical" print margins.
iMMToPicaConverts the coordinates of a point (expressed in millimeters) into system coordinates.
iNestedHeaderFooterPrints (or not) the page headers and footers of nested report.
iNewLinePrints a line (in Windows standard, with a rounded end) at specified coordinates.
iPageEndForces the move to the next page during the report print.
iPageHeightCalculates the height of printable page (in millimeters) while taking the top or bottom margins into account.
iPageHeightLeftCalculates the available height (in millimeters) left on the current page while taking into account the defined margins (top or bottom).
iPageNumReturns or initializes the number of the page currently printed.
iPageWidthCalculates the width (in millimeters) of the printable page while taking the left or right margins into account.
iParameterRetrieves the printer configuration and configures the print.
iParameterPDFDefines the options for the generated PDF file.
iParameterReportConfigures the printer by opening the configuration window.
iPicaToMMConverts the coordinates of a point (expressed in system coordinates) into millimeters.
iPrintSends the character string passed as parameter to the print buffer.
iPrintAreaPrints a text in a rectangular area.
iPrintBarCodePrints a bar code (inside a rectangle).
iPrintBlockForces a report block to print.
iPrintBodyComplementForces a body complement block to print while specifying the height of complement block.
iPrintImageSends the image file to print to the print buffer.
iPrintingNationModifies the current language for the next print (programmed print or report print).
iPrintReportPrints a report created with the report editor.
iPrintWordSends the character string passed in parameter to the print "buffer".
iReportPrintingStatusReturns the status of the current print.
iResetReinitializes the print settings (margins, font, paper format, orientation, ...) stored in the print library.
iResetNbPagesReinitializes the current number of pages, used in the preset controls such as "Number of pages" and "Page number and number of pages".
iRoundBorderPrints a border with rounded outlines at specified coordinates.
iSelectFontCreates a new print font from the standard window for font selection...
iSequencingAddAdds a report into a sequence of report prints.
iSequencingPrintPrints a sequence of reports.
iSkipLineForces one or more line break.
iSkipPageGenerates a page break: the corresponding code is sent to the printer queue.
iSubstBlockSubstitutes one block of the report with another block while the report is printed.
iTextHeightCalculates the height of the font for the text to print (in millimeters).
iTextWidthCalculates the width (in millimeters) of the text to print, according to the specified font.
iVLinePrints a vertical line at specified coordinates.
iWindowCancelConfigures the print cancel window..
iXPosUsed to manage the horizontal position (X-coordinate) of print cursor in the page.
iYPosUsed to manage the vertical position (Y-coordinate) of print cursor in the page.
Remark: The iPrintxxx functions only operate with the new Linux distributions.
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/02/2023

Send a report | Local help