PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Feb 26, 2021 7:41 am

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

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

Joined: Tue Aug 02, 2016 9:56 am
Posts: 40
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.

lzw.zip [110.92 KiB]
Downloaded 549 times
pdfsharp-690.zip [463 Bytes]
Downloaded 558 times

Gerben Vos
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:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group