PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Aug 23, 2017 3:49 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Sep 08, 2016 7:48 pm 
Offline

Joined: Tue Aug 02, 2016 9:56 am
Posts: 36
Location: Amsterdam, The Netherlands
PdfSharp gives an error when an object is empty (e.g., "14 0 obj endobj"). This is indeed invalid PDF, but Acrobat does not complain about it at all, so it should be handled.

This may result in the following error message:
- Unexpected token 'endobj' in PDF stream. (lzw.pdf)

Fixed by treating empty objects the same as null objects.

Discussion: this happens because PdfSharp tries to read all objects when opening the PDF (while parsing the xref tables). I think this is not really such a good idea, as it loads a lot of data into memory, not all of which may be used. Also, it seems to me that PDF has been designed to be easy to "lazy load", so why not do it? Is there some reason inside PdfSharp why this is done?

Patch attached.


Attachments:
lzw.zip [110.92 KiB]
Downloaded 80 times
pdfsharp-690.zip [463 Bytes]
Downloaded 80 times

_________________
Gerben Vos
Developer, ZyLAB Technologies B.V.
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group