Enabling PDF Conversion

PDF conversion commands are specified in the PDF Conversion Command and PDF Conversion Command for Mass Printing settings at System > Settings > Notifications > PDF Conversion Settings. These settings are not editable in the UI due to security reasons and have the following values:

  • PDF Conversion Command: /usr/local/bm/bin/pdfconversion.sh "@@SrcName@" "@@DstName@"

  • PDF Conversion Command for Mass Printing: /usr/local/bm/bin/pdfmassconversion.sh "@@SrcName@" "@@DstName@"

By default, the pdfconversion.sh and pdfmassconversion.sh scripts use the wkhtmltopdf PDF conversion tool, which is run with this command:

wkhtmltopdf --disable-javascript --header-left [section] --header-font-size 8 --header-right "Page [page] of [toPage]" --page-size A4 --orientation portrait --encoding utf-8 -B 5 -L 5 -R 5 -T 5 $SrcName $DstName

Important: If the PDF Conversion Command and PDF Conversion Command for Mass Printing settings contain custom values, move your customizations to the pdfconversion.sh and pdfmassconversion.sh scripts and reset the settings to their defaults by clicking the Reset To Default button.

If this default configuration does not meet your requirements, you have the following options to adjust how PDF conversion is performed and which PDF conversion tools are used:

Option 1: Use a Custom PDF Conversion Tool Placed on Your BSS Application Server

  1. Prepare a custom PDF conversion tool. In this example, we will use a binary file named customconverter.

  2. Prepare new scripts pdfconversion.sh and pdfmassconversion.sh, where each script invokes customconverter with the required parameters. For example:

    #!/bin/sh
    SrcName="$1"
    DstName="$2"
    customconverter -parameter value $SrcName $DstName
  3. Place customconverter, pdfconversion.sh, and pdfmassconversion.sh to the /usr/local/bm/bin directory of your BSS application server. For example:

    # pwd
    /usr/local/bm/bin
    
    # ls
    ...
    -rwxr-xr-x 1 root root    329 Dec 24  2020 customconverter
    -rwxr-xr-x 1 root root    329 Dec 24  2020 pdfconversion.sh
    -rwxr-xr-x 1 root root    329 Dec 24  2020 pdfmassconversion.sh
    ...

As a result, BSS will start using the new configuration for PDF conversion.

Important: When placing the binaries of a custom PDF converter tool on your BSS application server, you must take into account all necessary libraries of those binaries and their compatibility with the OS of that server.

Option 2: Use a Standalone PDF Conversion Service

  1. Prepare the API URL and credentials of a standalone PDF conversion service. For instance, you can use an online service such as Pdfcrowd, or a service deployed on a server or in a Kubernetes cluster located in your data center.

  2. Make sure the API of the service is accessible from your BSS application server.

  3. Prepare new scripts pdfconversion.sh and pdfmassconversion.sh, where each script makes calls to the API of the service with the required parameters. For example:

    #!/bin/sh
    SrcName="$1"
    DstName="$2"
    curl -f -u demo:ce544b6ea52a5621fb9d55f8b542d14d -o $DstName -F "file=@$SrcName" https://api.pdfcrowd.com/convert/
  4. Place your pdfconversion.sh and pdfmassconversion.sh to the /usr/local/bm/bin directory of your BSS application server. For example:

    # pwd
    /usr/local/bm/bin
    
    # ls
    ...
    -rwxr-xr-x 1 root root    329 Dec 24  2020 pdfconversion.sh
    -rwxr-xr-x 1 root root    329 Dec 24  2020 pdfmassconversion.sh
    ...

As a result, BSS will start using the new configuration for PDF conversion.

Important: When using a standalone PDF conversion service, make sure that all items of HTML files of your documents such as images, styles, and scripts are either included in those HTML files or are accessible from that service.