ZF-2603: Unknown trailer dictionary key 'DocChecksum' with OpenOffice-made PDF
Description
I opened a document in OpenOffice 2.3, and exported it to PDF with the default values. When I tried to load the PDF document, I got the following exception thrown:
Fatal error: Uncaught exception 'Zend_Pdf_Exception' with message 'Unknown trailer dictionary key: 'DocChecksum'.' in Zend/Pdf/Trailer.php:53 Stack trace: #0 Zend/Pdf/Trailer.php(68): Zend_Pdf_Trailer->_checkDictKey('DocChecksum')
1 Zend/Pdf/Trailer/Keeper.php(64): Zend_Pdf_Trailer->__construct(Object(Zend_Pdf_Element_Dictionary))
2 Zend/Pdf/Parser.php(335): Zend_Pdf_Trailer_Keeper->__construct(Object(Zend_Pdf_Element_Dictionary), Object(Zend_Pdf_Element_Reference_Context))
3 Zend/Pdf/Parser.php(455): Zend_Pdf_Parser->_loadXRefTable('1197829')
4 Zend/Pdf.php(291): Zend_Pdf_Parser->__construct('system/applicat...', Object(Zend_Pdf_ElementFactory_Proxy), true)
5 Zend/Pdf.php(244): Z in Zend/Pdf/Trailer.php on line 53
How to reproduce: Open OpenOffice v2.3, enter any text, and export to PDF. Then try to load that document using Zend_Pdf.
Suggested fix: Unless you're against adding the DocChecksum key to the $_allowedKeys, I would just add it to it.
Tested on 1.0.2, but pretty sure the problem exists in 1.0.3.
Comments
Posted by Andries Seutens (andries) on 2008-03-17T04:26:06.000+0000
Updated fix versions
Posted by Willie Alberty (willie) on 2008-03-18T01:28:49.000+0000
Logan, I don't have OpenOffice on my computer. Can you upload a sample document so I can take a closer look?
Posted by Andries Seutens (andries) on 2008-03-19T02:50:39.000+0000
The code freeze for 1.5.1 releases is currently scheduled for 21:00 (9:00pm) PST (GMT-8) on Friday, March 21. Would it be possible to address this issue before then? It would be sincerely appreciated :)
Posted by Willie Alberty (willie) on 2008-03-19T10:31:54.000+0000
I can fix it this week if someone is able to upload a sample document from OpenOffice.
Posted by Andries Seutens (andries) on 2008-03-19T10:52:20.000+0000
I attached a sample PDF export from an open office document. I have not verified if the error occures with this file.
Posted by Andries Seutens (andries) on 2008-03-19T10:52:43.000+0000
also attached the source document.
Posted by Willie Alberty (willie) on 2008-03-21T18:28:14.000+0000
Added "DocChecksum" to the valid trailer dictionary keys. Created ZF-2603 to remove trailer key limitations altogether.
Fixed in trunk and 1.5.1. Please verify and close.
Posted by Willie Alberty (willie) on 2008-03-21T18:29:06.000+0000
That is, created ZF-2944 to remove trailer key limitations altogether.