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.
_________________ Gerben Vos Developer
|