PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Dec 11, 2017 6:54 pm

All times are UTC




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

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.


Attachments:
SmoothShading.zip [138.05 KiB]
Downloaded 97 times
origami.zip [41.39 KiB]
Downloaded 96 times
pdfsharp-687.zip [827 Bytes]
Downloaded 102 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