mpdf / mpdf

PHP library generating PDF files from UTF-8 encoded HTML
https://mpdf.github.io
GNU General Public License v2.0
4.37k stars 1.06k forks source link

Support of PDF/A-2 and PDF/X-4 (for watermark transparency) #1625

Open Phascolarctidae opened 2 years ago

Phascolarctidae commented 2 years ago

I found this bug

If I use PDF/A and a watermark it throws the exception PDFA and PDFX do not permit transparency, so mPDF does not allow Watermarks!, but PDF/A supports transparency since PDF/A-2 and PDF/X since PDF/X-4

This is mPDF and PHP version and environment (server/fpm/cli etc) I am using

mPDF Version 8.0.17 PHP-FPM Version 8.0.12

This is the PHP code snippet I use

<?php
$Pdf = new Mpdf([
    'PDFA'     => true,
    'PDFAauto' => true,
]);

$Pdf->watermark('Example');
$Pdf->showWatermarkText = true;
$Pdf->AddPage();
$Pdf->Output();
finwe commented 2 years ago

I am afraid PDF/A handling in mPDF was created before PDF/A-2 and PDF/X-4 were introduced. PDF/X-4 requires PDF-1.6 and transparency part of PDF/A-2 requires PDF-1.7. I currently cannot ensure all will be up to newer standards when using higher PDF versions than PDF-1.4.

Will keep this here as a feature request with a help-needed label.