To generate high quality PDFs from HTML documents, use the tags <cfhtmltopdf> and <cfhtmltopdfitem>. This document describes the usage and functionalities of these tags.
The following terms are the commonly used in <cfhtmltopdf> (WebKit):
PDF generation is supported on both Windows and Linux operating systems. On Windows, there are no additional requirements for generating PDFs. On Linux, ensure that the following additional requirements are met:
On Linux platforms, install the following additional packages:
glibc.i686
zlib.i686
libX11.i686
ia32-libs
expat.i686
freetype .i686
X Window System
nss - softokn .i686
libxcb.i686
libXau.i686
libXext.i686
libSM.i686
libXrandr.i686
libXrender.i686
libXinerama.i686
For instance, you can use yum to install these packages as shown below:
$ yum install glibc.i686 |
Also, you need to install a few required fonts for generating PDFs on Linux. To install the fonts, perform the following tasks:
Download the compressed filefont - ibm -type1-1.0.3.tar.gz or font- ibm -type1-1.0.3.zip.The compressed file contains the required fonts.
Extract the downloaded zip file to the/usr/share/fonts directory.
<cfhtmltopdf> creates high quality PDF output from a text block containing CFML and HTML using the PDF Service Manager.
The WebKit implementation for <cfhtmltopdf> is referred as PDFG (acronym of PDF Generator) which is shipped as part of the Jetty installer. The component running inside the Jetty server is referred as the service manager, which takes request for PDF conversion from one or many ColdFusion server/s.
The WebKit implementation for <cfhtmltopdf>:
See <cfhtmltopdf> and <cfhtmltopdfitem>.
On RHEL 8, you can install the following packages:
For instance, you can use yum to install these packages as shown below:
yum install libX11 multilib-rpm-config
If you choose to install support for PDF generation during ColdFusion installation, a local PDF service manager (the “add-on service”) is installed.
You may need to use a remote PDF service manager instead of the local PDF service manager, if any of the following are true:
From the Administrator console, click Data & Services > PDF Service.
You can add or edit a PDF service manager by providing the name, host name , port, and other configuration details.
To add or edit a remote service manager, you need to provide the details of Jetty service running on local or remote machine over which the service manager is deployed. Follow the instructions below to complete this process:
| Note: Local Service Manager: You can edit, enable, disable, and verify the service manager. Note that a local service manager cannot be added or deleted and it's host name cannot be changed. |
Using the remote service manager, you can add, edit, delete, enable, disable, and verify the service manager.
PDF Service Managers section lists all the available PDF service managers.
| Note: The hostname for the local PDF service manager must be one of the server's local addresses. |
The description for each Action button (in the above image) is as follows:
Button |
Button Description |
Action |
Edit |
Enables users to edit the settings of the existing service manager. |
|
Verify |
Enables users to verify the current connection status of service manager. |
|
Delete |
Enables users to delete the PDF service. |
Note: Verify All Service Manager button is used to verify all the listed PDF Service Managers.
To configure the PDF service manager, use the configuration file ( web.xml ) located at <cf_install_root>/<CF Instance>/jetty/webapps/PDFgServlet/WEB-INF/. The available configuration settings are:
PDF service manager logging is used to track service manager related issues and generates verbose log that contains complete details about the service and conversion request lifecycle. Use it to track the PDF conversion request.
Note: Logging should not be used for an extended period of time in a production environment. Extended use will produce large logs and impact performance. The following sections describe the enhancements made to the PDF generation process. The PDFG service logs will be available at <jetty home>\logs. The names of the log files start with pdfg_access. |
In ColdFusion, the restricted DDX elements are supported for the Enterprise Edition. See this document for the list.
Sign in to your account