Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not same result for adding headers and footers to an existing pdf file with mpdf7 and mpdf8 #1868

Open
1 task done
jyd44 opened this issue May 7, 2023 · 0 comments
Open
1 task done

Comments

@jyd44
Copy link

jyd44 commented May 7, 2023

Guidelines

Description of the bug

The goal of the test is to add a header containing logos and a footer to an existing pdf v1.4 file.
This is done by using the UseTemplate method. (see the attached file test.php) for each page of the input file.
While using mpdf 7.1.7 the imported page is lying at the lower level as announced in the mpdf manual , it seems that it is not the case with mpdf 8.1.6.
In this last case, when the input pdf file is one page of text, the header and footer seems to be at the same layer, while if the input file is one page of tiles, the header and the footer are hidden by the imported content.
The attached file provides:

  • a php test file (test.php), to be run in a web environnement (appache plus php support)
  • a pdf input file with tiles only
  • a logo to be displayed in the header
    These three files must be at the same level than the 'vendor' directory

and also results files for every case: output for a full text pdf file and output for a full tiles pdf file.

mPDF version

mpdf 8.1.6, with PHP 8.2.0 vs mpdf 7.1.7 with PHP 7.2.33

PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

Env: Windows 11, Xampp 7.4.33 vs Windows 11 Xampp 7.2.33

Reproducible PHP+CSS+HTML snippet suffering by the error

mpdf_github.zip
The test.php must be invoqued through a http GET request.
Two parameters :

  • the basename of the input file without it's pdf extension, optional. If not set, a full text pdf file is created with mpdf itself.
  • the basename of the output file without it's pdf extension. mandatory

an example : http://localhost/mpdf/test.php?input=test_with_tiles&output=dest_with_tiles
another http://localhost/mpdf/test.php?output=dest_with_text

The zip file contains four dest files, two with mpdf7 and two with mpdf8

The two mpdf versions are installed using composer, for mpdf8 using the official installation procedure , for mpdf7 using 'composer install'
Unfortunately, it was not possible to run the two versions of mpdf in the same environnement, mainly PHP version because the requirements in the two install procedures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant