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.
- Install this module using the official Backdrop CMS instructions at
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:
. 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
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:
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/
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.
The actual mpdf Version was downloaded mPDF from https://github.com/mpdf/mpdf
Grant write access to the cache and images directories to your
Check https://github.com/mpdf/mpdf for further information.
MPDF LIMITATIONS and ISSUES
- Jörg Kienitz (https://github.com/vtad)
- 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