Hello,

David Roach wrote to me yesterday, because PoDoFo cannot read certain PDF 
files created by Xara Xtreme. You can find one of these PDFs attached.

I can confirm that PoDoFo does indeed not read the file correctly.      The 
strange thing is that from my understanding of the PDF reference the PDF file 
seems to be not correct and PoDoFo's behaviour is correct (apart from missing 
error handling). Unfortunately Acrobat Reader, poppler and Ghostscript all 
handle the file correctly, so I would be very surprised if PoDoFo is still 
correct. I hope someone can give some clarification on this issue.

This file has two xref tables and 15 objects. When reading the file beginning 
at the end, PoDoFo reads the first trailer (at the end), which has a /Size 
key which states that the file has 10 objects. That is why PoDoFo ignores any 
objects beyond 10. After reading this trailer, PoDoFo follows the offset 
specified by startxref and reads the xref table at the top of the file, which 
contains objects from 6 to 15. PoDoFo will read only up to object 10 0 obj 
and ignore the rest and will never get to the correct trailer behind the XRef 
table which contains the size key with the value 15 and other important 
information like the /Root key.

I was always under the assumption, that the trailer at the bottom of the PDF 
file has always have to have a correct /Size key. Creating a correct size key 
is easily possible when updating or creating a PDF file, so it should not be 
a problem for application developers to do this.

Is my assumption correct? Why does Acrobat not give an error than? 
If this is a misunderstanding of mine, I can easily fix this issue in PoDoFo. 
When ever an xref table is read with more object than specified in the last 
size key, we can resize our internal table. 

Best  regards.
        Dom
-- 
**********************************************************************
Dominik Seichter - [EMAIL PROTECTED]
KRename  - http://www.krename.net  - Powerful batch renamer for KDE
KBarcode - http://www.kbarcode.net - Barcode and label printing
PoDoFo - http://podofo.sf.net - PDF generation and parsing library
SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game,  for KDE
Alan - http://alan.sf.net - A Turing Machine in Java
**********************************************************************

Attachment: singleClosedPath.pdf
Description: Adobe PDF document

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to