PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

PdfSharp.Pdf.IO.PdfReaderException: Unexpected character...
http://forum.pdfsharp.de/viewtopic.php?f=2&t=3959
Page 1 of 1

Author:  sheber [ Thu May 16, 2019 4:59 am ]
Post subject:  PdfSharp.Pdf.IO.PdfReaderException: Unexpected character...

Hello!
I am using PDFsharp library of version 1.50.5147.0.
When i try import some PDF document in the class PdfSharp.Pdf.PdfDocument:
PdfDocument inputDocument = PdfReader.Open("920.pdf", PdfDocumentOpenMode.Import);
error occurs:
Unexpected character '0xffff' in PDF stream. The file may be corrupted. If you think this is a bug in PDFsharp, please send us your PDF file.
в PdfSharp.Internal.ParserDiagnostics.HandleUnexpectedCharacter(Char ch)
в PdfSharp.Pdf.IO.Parser.ReadSymbol(Symbol symbol)
в PdfSharp.Pdf.IO.Parser.ReadObject(PdfObject pdfObject, PdfObjectID objectID, Boolean includeReferences, Boolean fromObjecStream)
в PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider)
в PdfSharp.Pdf.IO.PdfReader.Open(String path, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider)
в PdfSharp.Pdf.IO.PdfReader.Open(String path, PdfDocumentOpenMode openmode)

This error is only available for some documents.
Size of tested pdf document is more than 256 kb and not included in this message.
link to download: https://transfiles.ru/x7dlt

is there a solution to this problem?
Please, help me!

P.S. sorry for my english

Author:  jsm25 [ Thu Oct 24, 2019 1:41 pm ]
Post subject:  Re: PdfSharp.Pdf.IO.PdfReaderException: Unexpected character

I am having a similar issue when I try to load existing PDFs to merge I get unexpected character 0xfff in PDF stream. However I can open the documents in Adobe reader and I have also merge these document successfully with other merge tools. Looking at the forum it appears I'm not alone in experiencing this difficulty I'm hoping that someone has a resolution.

unfortunately, the forum doesn't allow me to upload the PDF which is an issue.

Any assistance would be greatly received

Regards



John

Author:  Thomas Hoevel [ Thu Oct 24, 2019 1:52 pm ]
Post subject:  Re: PdfSharp.Pdf.IO.PdfReaderException: Unexpected character

jsm25 wrote:
unfortunately, the forum doesn't allow me to upload the PDF which is an issue.
Small PDFs can be uploaded as ZIP files.
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832

Most likely a corrupt PDF file.

Author:  semi07 [ Thu Feb 27, 2020 6:26 am ]
Post subject:  Re: PdfSharp.Pdf.IO.PdfReaderException: Unexpected character

I have exactly the same problem.
Any solution or workaround?

Author:  TH-Soft [ Thu Feb 27, 2020 8:03 am ]
Post subject:  Re: PdfSharp.Pdf.IO.PdfReaderException: Unexpected character

semi07 wrote:
Any solution or workaround?
Most likely a corrupt PDF file.
Use "Save as..." in Adobe Reader, usually this fixes the file.

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