George Eivaz
George Eivaz

Reputation: 145

mpdf importPage 8.0 does not work with 1.5 version PDF

Good Day, I am writing this request because I am using mpdf to generate PDFs that I can populate. I am using the latest mpdf library (8.00) I believe.

We do this with the following calls.

$mpdf = new \Mpdf\Mpdf();
$mpdf->SetDisplayPreferences('/CenterWindow');
$pagecount = $mpdf->setSourceFile($SourceFileNamePath);
$importPage = $mpdf->importPage($i);

The problem is that the setSourceFile and importPage fail on any PDF files that are 1.5 or greater. Is there a solution for this or is 1.4 the latest that will be supported on the mpdf platform? I have tried to look for the answer in the doc and was not able to do so easily or could not find it. Can someone help point me in the right direction, please.

All the best, George Eivaz

Upvotes: 0

Views: 519

Answers (1)

Jan Slabon
Jan Slabon

Reputation: 5058

Under the hood mPDF uses FPDI to import existing pages.

We (Setasign, creator of FPDI) offer a commercial add-on that let you import PDFs which uses a compression technic that was introduced in PDF 1.5.

You may also try to downgrade these documents with an external program. I'm aware of some people using Ghostscript for this.

Upvotes: 1

Related Questions