PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 4:53 pm

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:39 pm 
Offline

Joined: Tue Aug 02, 2016 9:56 am
Posts: 40
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 630 times
origami.zip [41.39 KiB]
Downloaded 641 times
pdfsharp-687.zip [827 Bytes]
Downloaded 643 times

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