Exception while opening PDF

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Exception while opening PDF

Ramon de la Fuente
Hi all,

Are there any types of PDF documents that Zend_Pdf cannot open?
I'm trying to open a certain PDF document, but Zend_Pdf::load() throws
the followtin exception (with trace):

"Zend_Pdf_Exception: PDF file syntax error. Offset - 0x22BF. Object
number expected."

C:\x\projects\zend_framework\library\Zend\Pdf\StringParser.php - 550
throw Zend_Pdf_Exception()

C:\x\projects\zend_framework\library\Zend\Pdf\Parser.php - 232
Zend_Pdf_StringParser->getObject("8895", Object)

C:\x\projects\zend_framework\library\Zend\Pdf\Parser.php- 455

C:\x\projects\zend_framework\library\Zend\Pdf.php - 289
Zend_Pdf_Parser->__construct("mydocument.pdf", Object, true)

C:\x\projects\zend_framework\library\Zend\Pdf.php - 242
Zend_Pdf->__construct("mydocument.pdf", null, true)

C:\x\projects\autodocuments\app\controllers\IndexController.php - 12

The result of the "$objNum" variable in Zend_Pdf_Stringparser line 545
is "ef", and that throws an exception for not being of ctype_digit...

        $objNum = $this->readLexeme();
        if (!ctype_digit($objNum)) {
            throw new Zend_Pdf_Exception(sprintf('PDF file syntax error.
Offset - 0x%X. Object number expected.', $this->offset - strlen($objNum)));

Reply | Threaded
Open this post in threaded view

Re: Exception while opening PDF

This post has NOT been accepted by the mailing list yet.
I get this same error.  As far as I can tell the PDF I'm trying to open is a perfectly valid PDF1.4 document.

exception 'Zend_Pdf_Exception' with message 'PDF file syntax error. Offset - 0x46DBF. Object number expected.'

Does anyone have any clues as to where I could look for a resolution?