Problem/Motivation

I am unable to install this with php 7.4 due to the mPDF dependency required as ^7.0.0.

Steps to reproduce

composer require drupal/pdf_using_mpdf
mpdf/mpdf[v7.1.7, ..., v7.1.9] require php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your php version (7.4.16) does not satisfy that requirement.

Proposed resolution

Update module code to work with mPDF 8.

Remaining tasks

TBD

User interface changes

None

API changes

Not sure

Data model changes

Not sure

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:

Comments

mortona2k created an issue. See original summary.

mortona2k’s picture

So far I can create a pdf without issues. I searched the code for functions mentioned in the changelog, but don't see any in use. https://github.com/mpdf/mpdf/blob/development/CHANGELOG.md

bryandenijs’s picture

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

aleix’s picture

Status: Active » Reviewed & tested by the community

Pushed in MR the change Bryan said, it works as it should then.

luongosb’s picture

Hey all, thanks for updating the code. Any idea when this will be available?

mortona2k’s picture

Status: Reviewed & tested by the community » Needs review

I believe for ^7.0.0, composer will allow 7.0.x, but no higher (IE not 7.1.0).
^7 means 7 or above, so 7.4 or 8.0.4.
^8.0.4 would mean 8.0.4 or above, and under 8.1.0 is required.

poorva’s picture

StatusFileSize
new22.45 KB

Since Drupal 9 is supporting PHP 7.4 there is no point to make this compatible with only PHP 8. Right now stable version of module is getting error due to this.

jasminewu’s picture

StatusFileSize
new291 bytes

It's urgent for me to fix the issue. And I generate a patch from pdf_using_mpdf-3205270

jasminewu’s picture

jasminewu’s picture

StatusFileSize
new290 bytes

Anyway, patch for php7.3 and php7.4

jasminewu’s picture

StatusFileSize
new290 bytes
hiralthaker’s picture

Hello All,

I am using Drupal8.9.18, PHP 7.4.22 and mPdf 8 on my server.

It is generating PDF with text properly while not adding images into PDF.

Can any one help?

Thanks

gilmord’s picture

Priority: Normal » Major

Hi, updating priority as Acquia will switch soon to PHP 7.4

Hee is a workaround while this is not merged:

1. composer remove drupal/pdf_using_mpdf
2. add this to the "repositories" section of your composer.json:

        {
            "type": "package",
            "package": {
                "name": "drupal_git/pdf_using_mpdf",
                "version": "2.2",
                "type": "drupal-module",
                "source": {
                    "url": "https://git.drupalcode.org/project/pdf_using_mpdf.git",
                    "type": "git",
                    "reference": "8.x-2.x"
                },
                "require": {
                    "mpdf/mpdf": "^8.0.4"
                }
            }
        }

3. composer require drupal_git/pdf_using_mpdf

Not the best solution but I was forced to switch to PHP 7.4 and this was the only thing blocking me.

jds1’s picture

#15 was the only way I was able to get out of dependency hell. A new release of this module that considers PHP 7.4 would be greatly appreciated.

bakulahluwalia’s picture

#15 works, thanks @gilmord
Tested successfully.

spuky’s picture

+1 for releasing this to help ease d9 uprgades...

ribel’s picture

Would be good to release a new version with updated mpdf asap.
We have tested that there are no regressions after the update.

pgshehata’s picture

+1 for releasing this to help php7.4 uprgades...

jsbalsera’s picture

#15 worked great, +1 for a new release.

ronaldtebrake’s picture

Status: Needs review » Reviewed & tested by the community

Think it's safe to say it's RTBC'ed :) we're also actively using this patch

rdplessis’s picture

# 15 works for me, +1 for new release as soon as possible

emil stoianov’s picture

+1 works for me
Release it !

gilmord’s picture

Issue tags: +LutskGCW23
gilmord’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, @all
merged into the latest dev.

gilmord’s picture

Status: Fixed » Closed (fixed)
honyik’s picture

Hello, I can't see a dev version available on this module's page and trying to download 2.x from github only redirects me back here, therefore I still can't add this via composer and the only thing I can do is to download the 2.2 version and fix it manually, what am I missing here? Thank you

gilmord’s picture

Hi @honyik looks like some bug (or feature) of git.drupalcode.org
I tried a couple of other projects - download leads to the project page on drupal.org.

You can use git to download the files like this:

git clone https://git.drupalcode.org/project/pdf_using_mpdf.git

After that, you can switch the branch to the latest dev and use the files however you need.

Also, I am not sure you will be able to fix anything manually, as the required library does not work with the packages of the fresh Drupal installation, and the maintainer of the library is not willing to fix that.

Better look at the alternatives like dompdf, also modules like entity_print can work with various alternatives of the mpdf (if I remember correctly).

viniciusosouza’s picture

Is there any way to this feature be merged on a new release?