You're viewing help content for version:

This article is applicable if you are installing AEM Forms on OSGi. For information, about installing AEM Forms on JEE, see the documentation in the Installing, Upgrading, and Clustering AEM Forms on JEE section in AEM Forms help and tutorials.

AEM Forms PDF Generator enables IT managers to centrally manage and control the creation of Adobe PDF documents throughout the enterprise. With it, employees can easily convert documents created within the organization to Adobe PDF files that can be viewed using the ubiquitous Adobe Reader® software. PDF Generator offers flexible deployment options, granular control over document properties, and feature sets that can meet the document conversion needs of every organization.

Prepare to install PDF Generator

Install third-party applications

The following list contains non-AEM Forms applications that PDF Generator can use for PDF generation on the server side. If you use any of these applications with PDF Generator, before configuring the PDF Generator, ensure that these non- AEM Forms applications and AEM Forms are installed on the same machine:  

  • Microsoft Office Word
  • Microsoft Office Excel
  • Microsoft Office PowerPoint
  • Adobe Acrobat DC Professional
  • WordPerfect X7
  • OpenOffice  

Converting native files from PDF Generator requires dismissing any initial registration, activation, and Improvement program dialogs with the option to not show them again.

Configure environment variables

If you installed the PDF Generator module and configured it to convert files to PDF, for some file formats, you must manually set an environment variable that contains the absolute path of the executable that is used to start the corresponding application. The table below lists the environment variables for the native applications that you have installed.

Note:

All environment variables and respective paths are case-sensitive.

Application

Environment variable

Example

JDK (64-bit)

JAVA_HOME

C:\Program Files\Java\jdk1.7.0_25

JDK (32-bit)

JAVA_HOME_32

C:\Program Files (x86)\Java\jdk1.7.0_25

Adobe Acrobat

Acrobat_PATH

C:\Program Files (x86)\Adobe\Acrobat 2015\Acrobat\Acrobat.exe

Notepad

Notepad_PATH

C:\WINDOWS\notepad.exe
Note: You can leave the Notepad_PATH variable blank.

OpenOffice

OpenOffice_PATH

C:\Program Files (x86)\OpenOffice.org 3

WordPerfect WordPerfect_PATH C:\Program Files (x86)\WordPerfect Office 12\Programs\wpwin12.exe

Note:

The environment variable OpenOffice_PATH is set to the installation folder instead of the path to the executable.

Note:

You do not need to set up the paths for Microsoft Office applications such as Word, PowerPoint, Excel,  and Project, or for AutoCAD. The Generate PDF service starts these applications automatically if they are installed on the server.

Creating an environment variable on Microsoft Windows

Perform the following steps to create an environment variable on Microsoft Windows:  

  1. Select Start > Control Panel > System.

  2. Click the Advanced System Settings, click Advanced tab, and click Environment Variables.

  3. In the System variables section, click New.

  4. Enter the environment variable name you need to set (for example, enter OpenOffice_PATH). This folder is the one that contains the executable file. For example, type the following path:

    C:\Program Files (x86)\OpenOffice.org 3

Install the Ink and Handwriting service

For Windows Server 2008 R2 and Windows Server 2012 install the Ink and Handwriting service. The service is required to open Microsoft PowerPoint files which use inking capabilities of Microsoft Office.

  1. Open the server manager by clicking the server manager icon from the Quick Launch tray.

  2. From the Features menu, click Add Features. Make sure that you select the Ink and Handwriting Services check box. 

  3. Select Features dialog box with Ink and Handwriting Services selected. Click Install and the service will be installed.

(OpenOffice only) Setting the PATH variable on Linux and UNIX

On Linux and UNIX, run the following command to set the PATH variable:

export OpenOffice_PATH=/opt/openoffice.org3

Note:

On Linux platform, OpenOffice must be installed as /root. If OpenOffice is installed as non-root, PDFG might not be able to convert OpenOffice documents.

Configure Adobe Acrobat Professional (Microsoft Windows only)

The Acrobat Professional root directory is designated as [Acrobat root]. Typically, the root directory for Acrobat DC Pro is C:\Program Files (x86)\Adobe\Acrobat 2015\Acrobat\Acrobat.exe.

Install and Configure Acrobat for use with PDF Generator

  1. If an earlier version of Acrobat is installed, uninstall it by using Add or Remove Programs in the Windows Control Panel.

  2. Install Acrobat DC Pro by running the installer.

  3. Open Acrobat and select Edit > Preferences > Updater.

  4. Deselect Automatically install updates and click OK.

Validate the Acrobat Installation

  1. Navigate to a PDF file on your system and double-click it to open it in Acrobat. If the PDF file opens successfully, Acrobat is installed correctly.

  2. If the PDF file does not open correctly, uninstall Acrobat and reinstall it.

    Note:

    Ensure that you dismiss all the Acrobat dialog boxes that are displayed after the Acrobat installation is completed and disable the automatic updates for Acrobat. Set the Acrobat_PATH environment variable to point to Acrobat.exe (For example, C:\Program Files (x86)\Adobe\Acrobat 2015\Acrobat\Acrobat.exe). After you start Acrobat for the first time, the dialog boxes for sign-in, welcome screen, and EULA appear. Dismiss these dialog boxes for all the users configured to use PDF generator.  

Run PDF Generator utility batch file

  1. Download the aem-fd-win-pkg archive.

  2. Extract the archive. The archive contains the PDF utility batch file and a System Readiness Tool.

  3. Navigate to [archived files]\jcr_root\etc\packages\day\cq60\fd\adobe-aemds-common-pkg-[version].zip\jcr_root\etc\packages\day\cq60\fd\adobe-aemfd-pdfg-common-pkg-[version].zip\jcr_root\etc\fd\pdfg\tools\adobe-aemfd-pdfg-utilities-[version].zip\scripts and run the following batch from the command prompt with administrative privileges: 

    Acrobat_for_PDFG_Configuration.bat

    Note:

    The batch file is specifically for Acrobat DC.  

Validate Acrobat installation and copy the configuration files  

  1. Navigate to [archived files]\srt and run the following command from the command prompt:
    cscript SystemReadinessTool.vbs [Path_of_reports_folder] en

    The tool checks if the machine is configured properly to run PDF Generator conversions and generates a report at the specified [Path_of_reports_folder].

  2. Navigate to [Path_of_reports_folder] and open the SystemReadinessTool.html file. Verify the report and fix the mentioned issues.

  3. Open Microsoft Word and navigate to the Acrobat tab. Click CreatePDF and perfrom a manual conversion.

    Note:

    If the System Readiness Tool reports that the pdfgen.api file is not available in the acrobat plugins folder then copy the pdfgen.api file from the [archived files]\plugins\x86_win32 directory to the [Acrobat_root]\Acrobat\plug_ins directory.

Configure HTML to PDF conversions

The HTML-to-PDF conversion process is designed to use the settings from Acrobat that override the settings from PDF Generator.

Note:

This configuration is required to enable the HTML-to-PDF conversion process, otherwise this conversion type fails.

Enable support for Unicode fonts in HTML to PDF conversions

Note:

The HTML-to-PDF conversion fails if a zipped input file contains HTML files with double-byte characters in filenames. To avoid this problem, do not use double-byte characters when naming HTML files.

Copy the Unicode font to any of the following directories as appropriate for your system:

  • Windows
    • [Windows root]\Windows\fonts
    • [Windows root]\WINNT\fonts
  • UNIX
    • /usr/lib/X11/fonts/TrueType
    • /usr/openwin/lib/X11/fonts/TrueType
    • /usr/share/fonts/default/TrueType
    • /usr/X11R6/lib/X11/fonts/ttf
    • /usr/X11R6/lib/X11/fonts/truetype
    • /usr/X11R6/lib/X11/fonts/TrueType
    • /usr/X11R6/lib/X11/fonts/TTF
    • /Users/cfqauser/Library/Fonts
    • /System/Library/Fonts
    • /Library/Fonts
    • /Users/ + System.getProperty(<user name>, root) + /Library/Fonts
    • System.getProperty(JAVA_HOME) + /lib/fonts
    • /usr/share/fonts (Solaris)

Note:

Ensure that you read and accept the license.  

Additional settings to enable htmltoPDF conversion on Linux, Solaris, and AIX

  • Install the latest version of 32-bit libcurl, libcrypto, and libssl libraries.
  • Ensure that the following path exist and point to the latest version of libraries:
    • /usr/lib/libcurl.so (or libcurl.a for AIX)
    • /usr/lib/libcrypto.so (or libcrypto.a for AIX
    • /usr/lib/libssl.so (or libssl.a for AIX)
  • (Only for IBM WebSphere running on Linux, Solaris, or AIX) Perform the following steps to configure IBM SSL socket provider for IBM WebSphere running on Linux, Solaris, or AIX:   
  1. Create a copy of the java.security file. The default location of the file is [WebSpeher_installation_directory]\Appserver\java_1.7_64\jre\lib\security.
  2. Open the copied java.security file for editing.
  3. Change the default SSL socket factories to use the JSSE2 factories instead of default IBM WebSphere factories:

    File with default contents:
    #ssl.SocketFactory.provider=com.ibm.jsse2.SSLSocketFactoryImpl
    #ssl.ServerSocketFactory.provider=com.ibm.jsse2.SSLServerSocketFactoryImpl
    WebSphere socket factories (in cryptosf.jar)
    ssl.SocketFactory.provider=com.ibm.websphere.ssl.protocol.SSLSocketFactory
    ssl.ServerSocketFactory.provider=com.ibm.websphere.ssl.protocol.SSLServerSocketFactory


    File with modified contents:
    ssl.SocketFactory.provider=com.ibm.jsse2.SSLSocketFactoryImpl
    ssl.ServerSocketFactory.provider=com.ibm.jsse2.SSLServerSocketFactoryImpl
    WebSphere socket factories (in cryptosf.jar)
    #ssl.SocketFactory.provider=com.ibm.websphere.ssl.protocol.SSLSocketFactory
    #ssl.ServerSocketFactory.provider=com.ibm.websphere.ssl.protocol.SSLServerSocketFactory

  4. To enable AEM Forms server to use the updated java.security file, while starting the AEM Forms server, add the following java argument:
    -Djava.security.properties= [path of newly created java.security file].

 

Note:

Ensure that the directories /usr/lib/X11/fonts and /usr/share/fonts exists. If the directories do not exist, then use the ln command to create a symbolic link from /usr/share/X11/fonts to /usr/lib/X11/fonts and another symbolic link from /usr/share/fonts to /usr/share/X11/fonts. Also ensure that the courier fonts are available at /usr/lib/X11/fonts.  

Note:

Ensure that all the fonts (Unicode and non-unicode) are available in the /usr/share/fonts or /usr/share/X11/fonts directory.  

Note:

On RedHat Enterprise Linux 6.x, the courier fonts are not available, download the font-ibm type1-1.0.3.zip archive. Extract the archive at /usr/share/fonts. Create a symbolic link from /usr/share/X11/fonts to /usr/share/fonts. Delete all the .lst font cache files from the Html2PdfSvc/bin and /usr/share/fonts directories. 

Change the file block settings for Microsoft Office

Change the Microsoft Office trust center settings to enable PDFG to convert older versions of Microsoft office documents.

  1. Click the File tab in any Office 2010 application. Under Help, click Options; the Options dialog box appears

  2. Click Trust Center, and then click Trust Center Settings.

  3. In the Trust Center settings, Step text click File Block Settings.

  4. In the File Type list, uncheck open for the file type that you want to be converted by PDFG.

Grant the Replace a process level token privilege (Windows only)

The User account used to start the application server should have the Replace a process level token privilege.

The local system accounts have the Replace a process level token privilege by default.

For the servers running with a user of Local Administrators group, the privilege must be granted explicitly. Perform the following steps to grant the privilege:  

  1. Open the Group Policy Editor for Microsoft Windows.  To open the Group Policy Editor, click Start, type gpedit.msc in the Start Search box, and then press ENTER.

  2. Navigate to Local Computer Policy > Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment and edit the Replace a process level token policy and include the Administrators group.

  3. Add the user to the Replace a Process Level Token entry.

Configuring Windows installation (Microsoft Windows only)

During installation and Configuration of AEM Forms, disable the User Access Control (UAC) Window.  

Disable the Windows UAC on Windows Server 2008 R2 and Windows Server 2012 R2

  1. To access the System Configuration Utility, go to Start > Run and then enter MSCONFIG.

  2. Click the Tools tab and scroll down and select Change UAC Settings.

  3. Click Launch to run the command in a new window.

  4. Adjust the slider to the Never notify level.

  5. When finished, close the command window and close the System Configuration window.

  6. Restart your computer.

To enable the UAC again, repeat the steps above and adjust the slider to a desired level before restarting your computer.

Disable Windows Error Reporting  

While converting a document to PDF using PDF Generator on Windows Server, Windows may report that the executable has encountered a problem and needs to close. However, it does not impact the PDF conversion as it continues in the background.

To avoid receiving the error, you can disable the Windows error reporting. For more information on disabling error reporting, see http://technet.microsoft.com/en-us/library/cc754364.aspx.

Install and configure PDF Generator

Perform the following steps before you install and configure the Publish instance:

  1. Ensure that the adobe-aemfd-<operating system>pkg 2.1.42 is installed on the AEM Forms instance.

  2. Open the Configuration Manager. http://[hostname]:[port]/system/console/configMgr

  3. Open the CQ-DAM-Handler-Gibson Font Manager Service and specify the path of the System Fonts directory

  4. Open the AEM Forms PDF Generator configuration UI in a browser window:
    http://[hostname]:[ports] /libs/fd/pdfg/config/ui.html

  5. In the User Accounts tab, provide credentials of a local user account, and click Submit.

    Note:

    You require a local user account to run the conversion. Keep a local user account handy. For steps to create a local user, see http://windows.microsoft.com/en-in/windows/create-user-account#create-user-account=windows-7.

  6. Open the AEM Forms PDF Generator configuration UI in a browser window and verify the local user account added in the previous step is reflected on the configuration UI.

  7. Add the following properties to the [crx-quickstart]\conf\sling.properties file:

    • sling.bootdelegation.class.com.rsa.jsafe.provider.JsafeJCE=com.rsa.*
    • sling.bootdelegation.class.org.bouncycastle.jce.provider.BouncyCastleProvider=org.bouncycastle.* 
  8. Restart AEM Forms instance.

Increase the maximum time-out value for ORB service

To increase the maximum time-out value, add properties to the Jacorb ORB provider OSGi configuration service. Perform the following steps to add the properties to the service:

  1. In AEM configuration manager, open the Jacorb ORB Provider service.

    Note:

    The default URL to AEM configuration manager is http://[server]:[port]/system/console/configMgr.

  2. To configure the pending reply timeout (also known as, CORBA client timeout) to 600 seconds (600,000 millis), set value of the Custom Properties.name field to

    jacorb.connection.client.pending_reply_timeout=600000

    Click Save.

You can specify any number of such properties. These properties are merged with the defaults provided in the aemds-jacorb.properties file. The file is embedded in the ORB provider bundle and passed to Jacorb during initialization. Since the custom properties are specified via the OSGi configuration, so the properties persist and survive server restarts.

Enable a non-administrator user to run PDF Generator

You can enable a non-administrator user to use PDF Generator. Normally, only users with administrative privileges can use PDF Generator. Perform the following steps to enable a non-administrator user to run PDF Generator:

  1. Create an environment variable name PDFG_NON_ADMIN_ENABLED. For detailed steps, see create the environment variable on Windows.

  2. Set value of the variable to TRUE.

  3. Restart the AEM forms instance.

Enable multi-threaded file conversion

PDF Generator, by default, converts only one OpenOffice, Microsoft Word, or PowerPoint document at a time. You can enable multi-threaded conversions to allow PDF Generator to convert multiple documents concurrently. For more information, see Enabling multi-threaded file conversions.

Known issues

  • HtmltoPDF (webkit route) is deprecated and does NOT work on AIX for AEM 6.2 Forms.
  • HtmltoPDF (webkit route) on Linux and Solaris has a dual dependency on openssl-0.9.x and openssl-1.0.x. This is a known issue that will be addressed by a formal patch but for the moment, it can be made to work with a workaround. For the workaround, see Addtional settings to use HTMLtoPDF (WebKit Route) on Linux and Solaris.
  • On updating the pdfg-core bundle, the following error can occure:  java.lang.UnsatisfiedLinkError: Cannot load native JNIWrapper library (jniwrap64.dll).
    To resolve the issue, restart the underlying AEM instance.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy