PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Feb 23, 2018 12:18 pm

All times are UTC

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

Joined: Tue Aug 02, 2016 9:56 am
Posts: 37
Location: Amsterdam, The Netherlands
PdfSharp does not do a full parse of dictionaries that occur in content streams, but instead just scans for the next '>' character. This fails if the dictionary contains nested dictionaries (delimited by << >>), or hexadecimal strings (delimited by < >).

Depending on the exact syntax in the content stream, this can result in these error messages:
- The given key was not present in the dictionary. (origami.pdf)
- Unexpected character '0x003e' in content stream. (found in confidential client PDFs only, sorry)
- Array within array... (SmoothShading.pdf)

Resolved by implementing a more thorough scanning of the dictionary. It should really be fixed by doing a proper recursive parse instead of a scan, but that would require more drastic changes to the library.

Patch attached.

SmoothShading.zip [138.05 KiB]
Downloaded 107 times
origami.zip [41.39 KiB]
Downloaded 104 times
pdfsharp-687.zip [827 Bytes]
Downloaded 113 times

Gerben Vos
Developer, ZyLAB Technologies B.V.
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 2 guests

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