gheeres / PDFSharp.Extensions

Extensions methods for PDFSharp to simplify common operations, including image extraction.
MIT License
34 stars 27 forks source link

Issue with PDF #1

Closed cur3n4 closed 10 years ago

cur3n4 commented 10 years ago

Hello, First of all thanks for the great library, it is excellent and very useful. I have found that sometimes the image PDFDictionary, contains an element for "Filter" which is actually a PDFArray with a single element. This causes an error as the PDFDictionaryExtension#ToImage method calls dictionary.Elements.GetName("/Filter") which fails if the element is a PDFArray. I cannot attach a sample PDF as it contains sensitive information, but I you are very interested I can try to generate one. I have done a crude modification to PDFDictionaryExtensions to check if the /Filter element is an array, if so then extracts the first element to determine the filter. However I am sure there must be a better way... Cheers

gheeres commented 10 years ago

Yes, please attach / send an example.

cur3n4 commented 10 years ago

Emailed it to you.

gheeres commented 10 years ago

Thanks. I received the file.

See commit 39e7f4016b0aa019e56cb0ea3242ca7321a92d03

Nuget package updated & published.