This article provides a solution for how to print PDF data stored in JobData or PDF files stored as attachments to JobData using Lasernet Developer version 8.
PDF data stored in JobData can be sent to the Print Output Port as raw data. PDF data can be received by an input port or a module that generates a PDF.
A list of JobInfos must be defined for the Print Output Module to enable printing of PDF data stored in JobData.
JobInfo | Description | Example |
---|---|---|
JobData | Binary PDF Data | [Binary] |
PrintMimetype | Mimetype of PDF file | Application/PDF |
When a PDF file is successfully printed, a log message is displayed next to the Print Output Module, showing that the PDF file has been processed and printed.
PDF document included as an attachment
PDF files can also be stored as attachments to JobData. In such a scenario, JobData can contain EMF data and the attachment(s) must contain PDF data.
Retrieve one or several PDF files via file access in JavaScript, the Database Module or File Retriever Module (file, FTP or HTTP) and insert them as print attachments via the required JobInfos.
A list of JobInfos must be defined for the Print Output Module to enable printing of PDF data files attached to JobData.
JobInfo | Description | Example |
---|---|---|
PrintAttachment[index] | Binary PDF Data | [Binary] |
PrintAttachmentMimetype[index] | Mimetype of PDF file | Application/PDF |
Additional information
Modules required
- Printer Output
The solution requires Foxit Reader for printing PDF documents. Foxit Reader be downloaded here: https://www.foxitsoftware.com/pdf-reader/
It is recommended to turn off any selected components, additional tasks and toolbars from the installer of Foxit Reader, since they are not required for printing PDF documents through Lasernet.
After installing Foxit Reader you must copy Foxit Reader.exe, located in the selected destination during installation, to the root of the Lasernet installation folder. In Lasernet 7.2 and newer, the file name FoxitReader.exe is also accepted. This filename is used for newer versions of Foxit Reader.
You may also run the Foxit Reader application manually and answer the required questions in the pop-up dialogs, before executing the application via the Lasernet Service.
The solution has been verified with Foxit Reader version 5.4.5.0124 and 7.0.6.1126 on the following operation systems:
- Windows 7
- Windows 8.1
- Windows Server 2008
- Windows Server 2012 R2
Printer Profiles are not supported in Lasernet when printing PDF documents via an external application like Foxit Reader.
Ensure that the Lasernet Service has the required user rights, to allow Foxit Reader to print to the selected Windows print queue, defined in the Printer Output settings.
Using Foxit Reader for parsing and printing PDF documents in the background, by the Lasernet service, is an undocumented feature. Formpipe Software is not responsible for that a future version of OS or Foxit Reader can cause the functionality to stop working.
Add a comment
Please log in or register to submit a comment.