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.

Issue fork print-2990466

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

paulvandenburg created an issue. See original summary.

paulvandenburg’s picture

Status: Active » Needs review
FileSize
4.04 KB

This 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.

paulvandenburg’s picture

FileSize
4.72 KB
1.43 KB

I'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.

TVoesenek’s picture

Status: Needs review » Reviewed & tested by the community

Tested locally on a php 7.1 site, works good.

jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

  • jcnventura committed 173908b on 7.x-2.x
    Issue #2990466 by jcnventura: Improve mPDF 7.x discovery.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

iiRealXz made their first commit to this issue’s fork.