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

Unexpected token error on a valid PDF
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3554
Page 1 of 1

Author:  saitheodore [ Wed Mar 15, 2017 2:11 pm ]
Post subject:  Unexpected token error on a valid PDF

Hi,

While opening a file in PDFSharp, we are getting an error saying "Unexpected token 'BOLD' in PDF stream. The file may be corrupted. If you think this is a bug in PDFsharp, please send us your PDF file."

I may not be able to send the file that triggered this error, before some compliance clearance. If someone can at least give me a pointer on what could be wrong or what needs to be checked will be appreciated.

Thanks
Sai Theodore

Author:  Thomas Hoevel [ Wed Mar 15, 2017 3:27 pm ]
Post subject:  Re: Unexpected token error on a valid PDF

Hi!

Replicate the exception in the debugger using the PDFsharp source code and you will know at which offset of the PDF file the exception occurs.

Are you using PDFsharp 1.50 beta 3b?

How do you know the PDF file is valid?

Author:  Gerben Vos [ Mon May 08, 2017 9:08 pm ]
Post subject:  Re: Unexpected token error on a valid PDF

In addition to what Thomas wrote: if you search for "Unexpected token" on the forum, you may find patches, including a few by me, that fix PDFsharp's parsing of some PDFs. I haven't seen your exact error, but you never know if those patches might help.

(Particularly this one: viewtopic.php?f=3&t=3450 .)

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