Recommended releases

Download Links

Converts a HTML page to PDF using mPDF PHP Library.
It allows you to generate the following pdf documents of any node:

where nid is the node id of content to render.


Enable the Print Using mPDF module: Administration > Modules (admin/modules)


  • There are several settings that can be configured in the following places:

    Administration > Modules (admin/modules)
    Enable or disable the module. (default: disabled)

    Configuration > User accounts > Permissions (admin/config/people/permissions)
    Under Print using mPDF module.

    Configuration > User interface > Print using mPDF settings
    This is where all the module-specific configuration options can be set.

ICON and css

  • A pdf Icon (used for the button) and a ccs file are included with this module:
    . file-icon.pdf-50px.png
    . css/prinmpdf.css with the (example) class hideinpdf to hide elements in the PDF outptut

PRINTMPDF custom extra field with a pdf button

  • This field is added to the types activated (default: all) through the "Print using mPDF settings"

  • Using the node display you can control the visibility, label and weight of the pdf button.
    Don't forget to flush the cache after making changes!

  • It should be hidden in the 'Default' display setting so the Icon does not appear in the
    generated pdf output.

. The button is wrapped with <div class="printmpdfbutton">



This api function is available to content developers that prefer
to generate a pdf file of custom path. The function takes two
parameters, first a rendered html content and an optional second
parameter, name of the pdf file.

Calling the function like this:


will return the PDF file for the current html passed to it.

It is also possible to specify the function like this:

printmpdf_api("<html><body>Hello</body></html>", "mypdf")

will return the PDF file with a "Hello" and file named "mypdf.pdf".


The printmpdf module requires the use of an external PDF generation tool.
The currently supported tools are mPDF. Please note that any errors/bugs in
those tools need to be reported and fixed by their maintainers.
DO NOT report bugs in those tools in the PDF Using mPDF module's issue queue

Default location /modules/printmpdf/mpdf/

MPDF support:

The mpdf Library Vesrion 6.1 is distributed with the printmpdf.
MPDF's support for CSS is considerably worse than the other tools.
Unicode is supported (use of Unicode fonts result in HUGE files). Page
header and footer are supported.



Current Maintainer


  • Originally written for Drupal by
    AbhijeetKalsi, gauravjeet_singh, sudanshu.singh, Bhupendra Singh, Yash Sharma


This project is GPL v2 software. See the LICENSE.txt file in this directory for
complete text.