Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unable to find xref table" with Dompdf0.6a + FPDI

Tags:

php

dompdf

fpdi

I'm trying to generate a pdf file from html using dompdf0.6a and that works fine, but then i need to encrypt it for protection, but i get error

FPDF error: Unable to find xref table - Maybe a Problem with 'auto_detect_line_endings'

However if I use older dompdf versions it works fine. I guess it generates newer pdf version that fpdi doesn't support.

btw. I traced it to FPDI/pdf_parser.php:208 (inside method pdf_read_xref())

like image 331
Artjom Kurapov Avatar asked Feb 27 '23 20:02

Artjom Kurapov


1 Answers

I was able to fix this by using Adobe Acrobat Professional v8 and going to "Document -> Reduce File Size" and then choosing something really old like "Acrobat 5.0 or Later", then the error was fixed!

like image 178
Aaron Avatar answered Mar 04 '23 02:03

Aaron