pauln / tcpdi_parser

Parser for use with TCPDI, based on TCPDF_PARSER
GNU Lesser General Public License v3.0
27 stars 47 forks source link

TCPDF_PARSER ERROR: Unknown PNG predictor 1 #5

Closed kozakzs closed 10 years ago

kozakzs commented 10 years ago

Hi,

I'm trying to use your tcpdi and tcpdi_parser for handling PDF files in PHP but I have some issue. I have old PDFs in 1.4 version, they're okay. But I have new PDFs in 1.5 version and there is some issue with them. I've got the following error message when I'm trying to import them with tcpdi: TCPDF_PARSER ERROR: Unknown PNG predictor 1

Here is a code snipplet I used for importing: <?php require_once('tcpdf/tcpdf.php'); require_once('tcpdf/tcpdi.php');

$pdf = new TCPDI(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pagecount = $pdf->setSourceFile($tempfile); //$tempfile is the 1.5 version PDF to import

?>

My php script stops running after the $pagecount row.

pauln commented 10 years ago

There were two issues which the sample PDF you sent me triggered - once I fixed the PNG Predictor issue (although I was setting the default correctly, I wasn't actually handling the default value!), another one showed up relating to the xref table listing objects inside objstreams as having an offset of 0. With these two issues fixed, your sample PDF now works for me.