PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Version: 19.0
Your version: XXA150056M

WinDevWebDev - Server codeWebDev - Browser codeWinDev MobileReports and QueriesWindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPadJavaPHPAjaxUser code (UMC)External languageHFSQLHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBODBCNative Accesses

iDestination (Function)
In French: iDestination

Configures the destination of the print. You have the ability to print:
  • on the printer directly (syntax 1 and 2)

  • in a file in text, HTM, RTF, PDF, PRN or XML format (syntax 3).


  • Versions 15 and later
    a duplicate copy directly (syntax 4).
    New in version 15
    a duplicate copy directly (syntax 4).
    a duplicate copy directly (syntax 4).
  • on a fax directly (syntax 5 and 6, sending a report to a fax number for example). See Sending faxes for more details.

Versions 19 and later
WinDevJava This function is now available for the Java applications.
New in version 19
WinDevJava This function is now available for the Java applications.
WinDevJava This function is now available for the Java applications.

Example
WinDevWindowsUser code (UMC)
// Print in HTML format
iDestination(iHTML, "C:\My documents\MyReport.HTM")
// "C:My documents\MyReport.HTM" corresponds to the name and
// path of the HTM file that will be created with "RPT_MySummaryReport"
iPrintReport(RPT_MySummaryReport)

WinDevWindowsLinuxUser code (UMC)
// Print in PDF format
FileName is string = CompleteDir(fCurrentDir()) + ...
"f" + Invoice + Customer + ".PDF"
iDestination(iGenericPDF, FileName)
iPrintReport(RPT_Invoice, Customer, Invoice)
// Checks whether it is a WebDev site
IF InWebMode() = True THEN
// Print performed from a WebDev site
// Send the file to the Web user
FileDisplay(FileName, "application/pdf")
Multitask(0)
// Delete the file on the server
fDelete(FileName)
END

WinDevWindowsUser code (UMC)
// PCL printer to use
iDestination(iPCL, "\\MyNetwork\MyPrinter")
// Print in PCL format: iDestination(iPCL, "\My documents\MyFile.PCL")

WinDevWindowsUser code (UMC)
// Generate a PRN file
iDestination(iPrinterFile, "C:\Temp\MyPrint.prn")

Syntax
WinDevJavaUser code (UMC)

Printing on the printer directly Hide the details

iDestination([<Destination> [, <Job Name>]])
<Destination>: Optional integer constant
Destination of the print.

iPrinterDirect print on the printer

<Job Name>: Optional character string (with quotes)
Name that must be given to the print. This name will be used to identify the print in the list of jobs processed by the printer.
WinDevUser code (UMC)

Printing on a PCL printer directly Hide the details

iDestination(<iPCL> , <Printer to Use>)
<iPCL>: Constant
iPCL: Constant used to print on a PCL printer directly.

Caution: you cannot print in landscape mode on a PCL printer.

<Printer to Use>: Character string (with quotes)
Path and name of the PCL printer used. This printer must be accessible.
If this printer is associated with the infrared port of the Pocket PC, this parameter must correspond to:
  • the "IRDA:" string: if a single printer is enabled on the infrared port during the print.
  • the "IRDA:<Printer to use>" string: if several printers are enabled on the infrared port during the print.
If this printer is accessible via Bluetooth, this parameter must correspond to "<Name of virtual outgoing port of Bluetooth>:".
If several printers use Bluetooth technology, a window allowing the user to choose a printer will be displayed before the print. See the Notes for more details.

If this printer is accessible via Wi-Fi or network, this parameter must correspond to the name and UNC path of the printer.

Printing in a file (HTM, PCL, PDF, PRN, RTF, XLS, XML, ...) Hide the details

iDestination([<Type of Destination File> [, <Name of File to Create>]])
<Type of Destination File>: Optional integer constant
Used to configure the type of file to create:

iFileDirect print in a text file. The file will be named <Report name>.TXT (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application. If <Name of file to create> is specified, the name of the file will be <Name of file to create>.TXT.
Caution: the printer setting is very important. See the Notes.

LinuxJava This constant is not available.
iGenericFileDirect print in a text file. The file will be named <Report name>.TXT (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application. If <Name of file to create> is specified, the name of the file will be <Name of file to create>.TXT.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.

LinuxJava This constant is not available.
iPrinterFileDirect print in a PRN file (<Name of File to Create> file). <Name of File to Create> must contain the full name of the PRN file.
Caution: the printer setting is very important. See the Notes.

LinuxJava This constant is not available.
iHTMLDirect print in an HTML file while using a style sheet. The file will be named <Report Name>.HTM (where <Report Name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
This print mode must be used to support the layers in the HTML pages.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.HTM. No preview will be displayed.
Caution: the printer setting is very important. See the Notes.

LinuxJava This constant is not available.
iGenericHTMLDirect print in an HTML file while using a style sheet. The file will be named <Report Name>.HTM (where <Report Name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
This print mode must be used to manage the layers in the HTML pages.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.HTM. No preview will be displayed.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.

LinuxJava This constant is not available.
iHTMLWithoutCSSDirect print in an HTML file without using a style sheet. The file will be named <Report Name>.HTM (where <Report Name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
This print mode does not support layers in the HTML pages.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.HTM. No preview will be displayed.
Caution: the printer setting is very important. See the Notes.

LinuxJava This constant is not available.
iGenericHTMLWithoutCSSDirect print in an HTML file without using a style sheet. The file will be named <Report Name>.HTM (where <Report Name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
This print mode does not support layers in the HTML pages.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.HTM. No preview will be displayed.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.

LinuxJava This constant is not available.
iPCLDirect print in a PCL file (<Report Name>.PCL file created in the directory of the application).
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.PCL.

LinuxJava This constant is not available.
iPDFDirect print in a PDF file. The file will be named <Report name>.PDF (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.PDF.

Java This constant is not available.
iGenericPDFDirect print in a PDF file. The file will be named <Report name>.PDF (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.PDF.
Caution: The maximum format is the A4 format.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.

iRTFDirect print in a RTF file. The file will be named <Report name>.RTF (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.RTF. No preview will be displayed.
Caution: the printer setting is very important. See the Notes.

LinuxJava This constant is not available.
iGenericRTFDirect print in a RTF file. The file will be named <Report name>.RTF (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.RTF. No preview will be displayed.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.

LinuxJava This constant is not available.
iXLSDirect print in an XLS file. The file will be named <Report name>.XLS (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.XLS. No preview will be displayed.

LinuxJava This constant is not available.
iGenericXLSDirect print in an XLS file. The file will be named <Report name>.XLS (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.XLS. No preview will be displayed.
This print mode does not use the current printer driver, so that an identical result is guaranteed from a computer to another one.

LinuxJava This constant is not available.
iXMLDirect print in an XML file. The file will be named <Report name>.XML (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.XML. No preview will be displayed.

LinuxJava This constant is not available.
iGenericXMLDirect print in an XML file. The file will be named <Report name>.XML (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.
If <Name of file to create> is specified, the name of the file will be <Name of file to create>.XML. No preview will be displayed.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.

LinuxJava This constant is not available.
<Name of File to Create>: Optional character string
Name of the generated file. If this parameter is not specified, the name of the generated file corresponds to "Report Name". When printing in PRN format (with the iPrinterFile constant), the full name of the file to create must be specified.
WinDevWindowsUser code (UMC)

Printing a duplicate copy Hide the details

iDestination(<Destination Type> [, <Name of File to Create> [, <Certificate> [, <Password>]]])
<Destination Type>: Integer constant
Used to configure the type of file to create:

Versions 15 and later
iDuplicate
New in version 15
iDuplicate
iDuplicate
Direct print in a duplicate file. The file will be named <Report name>.DPL (where <Report name> corresponds to the name of the report defined in the report editor). This file is created in the directory of the application.

Caution: This constant can only be used to print a duplicate copy and not to start a print.
To create a duplicate copy of a print, we recommend that you use iParameterDuplicate then iDestination to print on the printer.

<Name of File to Create>: Optional character string
Name of the duplicate file to create (without extension). The created file will be <Name of file to create>.DPL.

If this parameter corresponds to an empty string (""), the name of the generated file will correspond to "Report Name".DPL.

<Certificate>: Certificate variable
Versions 16 and later
Name of the Certificate variable containing the certificate that will be used to sign the duplicate.
New in version 16
Name of the Certificate variable containing the certificate that will be used to sign the duplicate.
Name of the Certificate variable containing the certificate that will be used to sign the duplicate.
<Password>: Character string (with quotes)
Versions 16 and later
Password of the generated duplicate.
New in version 16
Password of the generated duplicate.
Password of the generated duplicate.

WinDevUser code (UMC)

Printing on a fax directly without managing a status report (Windows 2000 and XP) Hide the details

iDestination(<iFax> , <Fax Number to Dial>)
<iFax>: Constant
iFax: Constant used to print on a fax directly.
<Fax Number to Dial>: Character string
Phone number corresponding to the fax where the print must be sent.
Caution: A modem must be installed on the current computer. The fax number must correspond to the features specified when configuring the modem.
WinDevUser code (UMC)

Printing on a fax directly while managing a status report (Windows 2000 and XP) Hide the details

<Result> = iDestination(<iFax> , <Fax Number to Dial> , <Fax Name> [, <Name or Identifier of Fax Server>])
<Result>: Integer
  • Identifier of the connection to the fax server,
  • 0 if an error occurred. The corresponding error message is returned by ErrorInfo.
<iFax>: Constant
iFax: Constant used to print on a fax directly.
<Fax Number to Dial>: Character string
Phone number corresponding to the fax where the print must be sent.
Caution: a modem must be installed on the current computer. The fax number must correspond to the features specified when configuring the modem.
<Fax Name>: Character string
Name used to identify the outgoing fax. The status of the outgoing fax is returned by FaxStatus.
<Name or Identifier of Fax Server>: Optional character string or integer
Share name of the fax server.
If this parameter is not specified or if it corresponds to an empty string, the fax server corresponds to the default fax server.
Caution: the fax server must be started and configured in outgoing mode. See Sending faxes for more details.
Identifier of the fax server: If FaxConnect was used before iPreview, this parameter may correspond to the identifier of the fax server connection returned by FaxConnect.

Remarks

When should I use iDestination?

iDestination must be the first print function called. It must be called before iPrint, iCreateFont, etc. However, iDestination must be called afteriConfigure or iParameter.

Note: iDestination can be called before printing a report (with iPrintReport) to choose the destination of the print.

WinDevWindowsUser code (UMC)

Printing in HTML

  • If the print is performed in an HTML page with a style sheet (iHTMLCSS constant), the style sheet is included in the HTML file. The method for printing in an HTML file is identical to the method for printing on a printer. The layers are supported and the management of the font size is precise.
  • If the print is performed in an HTML page without style sheet (iHTML constant), the following limitations may occur:
    • management of font size not precise
    • overlay not supported. You cannot write on an image for example.
  • The fonts oriented at 90° are not printed properly in the HTML file: the text is displayed with an horizontal font.
  • The rounded borders are not printed. They are replaced by standard borders.

WinDevWindowsUser code (UMC)

Printing in XLS

  • The Image, Bar Code and Chart controls are not printed.

WinDevWindowsUser code (UMC)

Printing in RTF

  • Printing in RTF format only supports the text (with its style) and the images. The overlay of objects is not supported (lines or images). Several text lines cannot be displayed beside an image for example.
  • The fonts oriented at 90° are not printed properly in the HTML file: the text is displayed with an horizontal font.
  • To print in RTF format, the "RICHED20.DLL" file must be found on the current computer. In most cases, the "RICHED20.DLL" file is found in the system directory of Windows.
  • The borders are not printed.
  • The tables are not supported by the RTF format.

WinDevWindowsUser code (UMC)

Configuring the printer for printing in HTML, RTF and text format

  • If the print is performed in a text file, only the text is retrieved: the lines, the images, ... are ignored.
  • Printing in HTML, RTF or text format depends on the configuration and on the resolution of the current printer. Therefore, if the current printer is configured in landscape mode with margins, these options will be used when printing in HTML, text or RTF format.
  • The finer the printer resolution is, the better the quality of the RTF, text or HTML print will be.
  • To avoid the overlapping problems when printing in HTML mode, you have the ability to adjust the printer settings.

WinDevWindowsUser code (UMC)

Printing in PRN format

When printing in PRN format, the PRN file is specific to the selected printer. This file is directly created by the printer driver, it is a binary file that can be interpreted by the printer.

This file can be printed thereafter on the specified printer or on any other printer of the same type via the "Print" command of DOS. The syntax of this command is:

Print /D:\\<Computer name>\<Name of declared printer> <Name of PRN file>

Example:

Print /D:\\Doc_Computer\CanonLBP Output.prn

Note: For a network printer, you must use the share name and not the name of the printer. The share name is found in the "Share" tab of the printer description.

WinDevWindowsUser code (UMC)

Printing in XML

When printing in XML format, only the data is printed. The characteristics of the page layout (lines, ...) are ignored.

WinDevWindowsUser code (UMC)

Characteristics of the print

  • When printing in PDF format, the characteristics of the created PDF file can be configured by iParameterPDF.
  • When printing in XLS format, the characteristics of the created XLS file can be configured by iParameterXLS.

WinDevWindowsUser code (UMC)

Printing on a fax

Two syntaxes can be used to send a print to a fax:
  • Fax without management of status report. The print (performed thereafter by iPrintReport for example) is directly sent to the specified phone number.
  • Fax with management of status code. The print (performed thereafter by iPrintReport for example) is sent to the specified phone number via a fax server. iPreview returns the identifier of the connection to this fax server. This identifier, as well as the name given to the fax, allow you to check the status of the outgoing fax with the Fax functions. See Sending faxes for more details.

WinDevWindowsUser code (UMC)

Printing a fax in landscape mode

To configure the print of a fax in landscape mode (printing several faxes, including one in landscape mode), the print functions must be used in the following order:
  1. iDestination associated with the iFax constant
  2. iParameter used to switch to landscape mode.
If this order is not respected, the setting of the landscape mode will be ignored by the driver for fax management.

Example:

iDestination(iFax, "00046032032","Fax")
iParameter("ORIENTATION=LANDSCAPE")
iPrint("Print in landscape mode")
iEndPrinting()

WinDevWindowsUser code (UMC)

Using a fax server installed on a computer other than the current computer

You have the ability to use a fax server installed on a computer other than the current computer. In this case, the computer where the fax server is installed must be running Windows Server 2003. The fax server must be shared. Then, the name of the fax server must be specified in iDestination.

The computer from which the faxes will be sent must be equipped with a local fax server.

For example, if the fax server is installed on "FaxServer1", use the following syntax:

iDestination(iFax, "00046032032","Fax","\\FaxServer1\Fax_Share")

WinDevWindowsUser code (UMC)

End of print

iEndPrinting must necessarily be called to end the print except after a call to iPrintReport.

The next prints will be performed on the printer except if iDestination is called again.

WinDevWindowsUser code (UMC)

Printing via Bluetooth

To print via Bluetooth, you must:
  • use a PCL printer.
  • use a printer that supports the Bluetooth serial layer.
  • know the name of the Bluetooth virtual outgoing port. This name can be retrieved from the Bluetooth settings of the PC/Pocket PC or from the documentation of the PC/Pocket PC.
    In most cases, this name corresponds to "COM8:".
See Printing via Bluetooth for more details.

Components
WinDev wd190prn.dll
Java wd190java.jar
Linux wd190prn.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment