Loading...


Related Products


Date Published: May 19, 2025

Acquia Cloud and wkhtmltopdf

Some Drupal contributed modules require a method to convert HTML (or other formats) into PDF. One of the ways to do that is using the command line-based tool wkhtmltopdf.

Unfortunately, wkhtmltopdf is not supplied out of the box within the versions of Ubuntu that Acquia Cloud instances run. Wkhtmltopdf may also require additional fonts for multilingual PDF generation which are not installed on the Acquia Cloud platform.

Also, be aware that future changes to the underlying servers (for example, changes in the OS version) can cause your wkhtmltopdf binary to stop working; customers would be responsible for handling upgrading of this tool as well.

Ubuntu 22.04

When the printable module (or any code using wkhtmltopdf) breaks on Acquia Cloud Next with a libssl.so.1.1 error, it’s because Ubuntu 22.04 uses *OpenSSL 3* and no longer includes OpenSSL 1.1 by default. To work around this:
  1. Download the official Ubuntu 22.04 .deb package from wkhtmltopdf’s GitHub release:
    wkhtmltox_0.12.6.1-2.jammy_amd64.deb
  2. Extract the binary using dpkg-deb -x on an Ubuntu machine or VM
  3. Run ldd on the extracted binary to verify its dependencies:
    • It uses libssl.so.3 and libcrypto.so.3, which are standard in Ubuntu 22.04 — so it’s safe for Acquia Cloud Next and does not rely on libssl.so.1.1.
  4. Add the binary to your application in a suitable location, e.g:
    sites/xxxxxx/files/scripts/wkhtmltopdf/wkhtmltopdf
  5. Update settings.php with:

    $config['printable.settings']['pdf_tool_path'] = DRUPAL_ROOT . '/sites/xxxxxx/files/scripts/wkhtmltopdf/wkhtmltopdf';
The above example puts the files into your code adjacent files directory. You can either put thewkhtmltopdf library in your files directory, or if you prefer add it to your repository and deploy it as you prefer. Either avoids any need for system-level installation or container changes and works within the ACN environment.

You can change your Ubuntu version on a per environment basis under Configuration > Operating System, see https://docs.acquia.com/acquia-cloud-platform/docs/manage-apps/configuring-os-versions

Note: We can not comply with customer requests to install this software directly as an Ubuntu package (.deb).

Alternative Solutions

The following are not guaranteed to work for every scenario, and will require some time from your development team to evaluate and test. Note that Acquia Support does not offer help on installing nor testing these workarounds.

Some customers have had luck installing a pre-compiled binary of wkhtmltopdf by using this Github project: https://github.com/SilvertipSoftware/wkhtmltopdf-amd64 which is available in Packagist and can be installed with Composer as a dependency. Acquia Cloud uses the x86_64 architecture, which is equivalent to the amd64 architecture this package supports.

 

Additionally, there are three other PDF generation utilities which are much more compatible with our platform though. They're PHP-libraries that you could add into the /docroot/sites/all/libraries directory of your Git repository:

  • dompdf
  • mPDF (only in the 7.x-2.x branch)
  • TCPDF

For these options, you will be responsible to verify they are compatible with the modules and/or processes you are developing in your site. 

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation