PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Key Not found and Unexpected Charater
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3677
Page 1 of 1

Author:  Qaisrani [ Mon Oct 23, 2017 5:42 am ]
Post subject:  Key Not found and Unexpected Charater

Hi,

In my app I download pdf file and read its content to use information. Previously website was publishing PDF-1.5 and recently they have changed it %PDF-1.4, also pdf average size is increased from 150kb to 390kb, which means the software generating pdf is changed. Both files open without any problem in Adobe Reader, Foxit Reader or Edge.

With this change I am getting following exceptions for following function:

ContentReader.ReadContent(inputDocument.Pages[i])

Page 0: The given key was not present in the dictionary
Page 1 & 2: Unexpected Character "0x¥" in content stream. Stream may be corrupted or the feature is not implemented. If you think it is a bug in PDFSharp, send us your file.
Page 3: Unexpected Character "0x " in content stream. Stream may be corrupted or the feature is not implemented. If you think it is a bug in PDFSharp, send us your file.

Kindly check the file from following link and guide for the solution.

https://www.police.wa.gov.au/~/media/Files/Police/Traffic/Cameras/Camera-locations/MediaLocations-23102017-to-29102017Week1.pdf?la=en


Thanks

Author:  Thomas Hoevel [ Mon Oct 23, 2017 7:59 am ]
Post subject:  Re: Key Not found and Unexpected Charater

Hi!

I couldn't replicate the issue with the PDFsharp Document Explorer.

Are you using the latest version of PDFsharp 1.50?

See also:
viewtopic.php?f=2&t=832

Author:  Qaisrani [ Tue Oct 24, 2017 5:33 am ]
Post subject:  Re: Key Not found and Unexpected Charater

Hi Thomas,

I am using PDFSharp.Xamarin Project from following link:

https://github.com/roceh/PdfSharp.Xamarin

Added it in my project as library project.

If this version is older, can you please guide me on how to update without compromising Xamarin compatibility.

Thanks

Author:  Thomas Hoevel [ Tue Oct 24, 2017 7:47 am ]
Post subject:  Re: Key Not found and Unexpected Charater

Qaisrani wrote:
If this version is older, can you please guide me on how to update without compromising Xamarin compatibility.
Sorry, but I am not familiar with that branch of PDFsharp and cannot provide any guidance.
A merge tool that can work with three folders may be helpful.

Author:  Gerben Vos [ Mon Oct 30, 2017 5:18 pm ]
Post subject:  Re: Key Not found and Unexpected Charater

I'm not sure on which version that Xamarin build is based, but if upgrading to or merging with 1.50-beta4 is not feasible, you could try to apply one or both of these patches intended for 1.50-beta3, which fix some cases of these error messages:

viewtopic.php?f=3&t=3448
viewtopic.php?f=3&t=3449

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/