Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently the print_pdf_mpdf module does not detect the mpdf library since version 7.x. This is caused by a restructuring of that library.
However you need version 7.x of the mpdf library when using PHP 7.1.
Comment | File | Size | Author |
---|---|---|---|
#3 | interdiff-2-3.txt | 1.43 KB | paulvandenburg |
#3 | print-support_mpdf_v7plus-2990466-3.patch | 4.72 KB | paulvandenburg |
Issue fork print-2990466
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
paulvandenburg CreditAttribution: paulvandenburg as a volunteer commentedThis adds support for v7+ of mpdf.
It however does expect that composer install has been run in the mpdf library.
The problem is that since v7 there is no longer a version number inside the library, so it is hard to detect the used version.
Which is needed to switch between the 7+ and 6- logic for the library.
But this solution works.
Comment #3
paulvandenburg CreditAttribution: paulvandenburg as a volunteer commentedI've discovered another issue which is actually more related to how print_pdf handles library tool_dirs.
When a library defines a tool_dir in its info hook, print_pdf will check if it exists and is writable in its requirements hook.
However it will make no attempt to create such a folder, even when it has the permissions to do so.
As a result it keeps complaining on your status page.
The simple solution for now is to remove the tool_dir for version 7.x of mpdf. It no longer uses that tool_dir.
I've also fixed the version function where I made a small mistake for detecting 7.x versions of mpdf.
Comment #4
TVoesenek CreditAttribution: TVoesenek commentedTested locally on a php 7.1 site, works good.
Comment #6
jcnventura CreditAttribution: jcnventura commentedThanks!