Advertising sustains the DA. Ads are hidden for members. Join today

PDF Engine Support

Last updated on
14 December 2018

If you can't see what you're looking for and have suggestions for alternative engines for PDF, EPub and MOBI, just create an issue.

WkHtmlToPdf

The Wkhtmltopdf library is supported in Drupal 7 and Drupal 8.

The wkhtmltopdf binary must be installed on the server. This module will not work unless you're able to upload/install the tool and make it executable. Some shared hosts may not allow this (only ftp access). If you have ssh access it might work, depending on the host.

Composer installation

Recommended installation method is Composer:

composer require h4cc/wkhtmltopdf-amd64 (or i386)
composer require mikehaertl/phpwkhtmltopdf

NB! As of December 2018, h4cc/wkhtmltopdf-amd64 is not up-to-date - ref issue 31 on Github. You may want to install manually - see below.

Then switch to Php Wkhtmltopdf in admin/config/content/entityprint. Also you have to fill Binary location what usually should be: "[project root]/vendor/bin/wkhtmltopdf-amd64"

Manual installation

You can download binaries for Windows, Linux (Debian, Ubuntu and CentOS) and MacOS from wkhtmltopdf.org. You can download Wkhtmltopdf from many other sources too. Normally you can find an (outdated) version of Wkhtmltopdf using the package manager of your Linux distribution.

Wkhtmltopdf also have some dependencies what varies by Linux distribution. Your best option is to search for the recommended solution if wkhtmltopdf doesn't work after installation.

How to check wkhtmltopdf path

You can use which or whereis to locate the wkhtmltopdf binary file if it was installed inside the PATH.

Dompdf

The Dompdf is supported in Drupal 8 only.

TCPDF

The TCPDF v1 is supported in Drupal 8 only. We may support v2 of the library in the future.

mPDF

The mPDF library has been reviewed and decided against adding it to this project, as Dompdf provides a much better implementation if you're looking for a pure PHP implementation for HTML to PDF conversion.

HTML2PDF

Does not support HTML5 and therefore did not work as expected with Drupal 8.

Help improve this page

Page status: No known problems

You can: