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

PDFsharp cannot open PDFFile
http://forum.pdfsharp.com/viewtopic.php?f=2&t=3791
Page 1 of 1

Author:  KruNo [ Wed May 16, 2018 9:36 am ]
Post subject:  PDFsharp cannot open PDFFile

Hello,

I have a strange problem with a PDF. A friend of mine can open the PDF with PDFsharp without any problems, but I get an error message.

"Unexpected token'2284.7244' in PDF stream. The file may be corrupted. If you think this is a bug in PDFsharp, please send us your PDF file."

Person 1 can open the PDF without any problems
Persons 2 & 3 cannot open the PDF with the corresponding error message

The PDF file can easily be opened with Foxit Reader & Adobe Reader, so it is accordingly valid.
The PDF file is 19 MB so i uploaded them extern.
Millimeterpapier.pdf

We use PdfSharp-wpf.dll in Version 1.50.4740.0

I hope you can help me.

Best Regards,
Noel

Author:  Thomas Hoevel [ Wed May 16, 2018 10:11 am ]
Post subject:  Re: PDFsharp cannot open PDFFile

Hi, Noel!
KruNo wrote:
I hope you can help me.
I can open the file without "unexpected token" exception.
The token '2284.7244' appears often in the PDF file; knowing the offset of the token in the PDF file might help.

Use the IssueSubmissionTemplate to make the issue replicable.
See also:
viewtopic.php?f=2&t=832

Author:  mohamed.m [ Mon Jun 25, 2018 3:21 pm ]
Post subject:  Re: PDFsharp cannot open PDFFile

Hello,

I have a problem with a pdf. I can not open the pdf in PDFSharp.

"Unexpected token 'n' in PDF stream. The file may be corrupted. If you think this is a bug in PDFsharp, please send us your PDF file."

The PDF file can be viewed in Adobe reader. I am using PDF Sharp version - 1.50.4845-RC2a.

Please provide your support.

Best Regards,
Mohamed Musthafa

Author:  Thomas Hoevel [ Mon Jun 25, 2018 3:42 pm ]
Post subject:  Re: PDFsharp cannot open PDFFile

Hi!
mohamed.m wrote:
Please provide your support.
You get the support you pay for.
There is nothing we can do without the PDF file.

Please try "Save as" in Adobe Reader and test if the newly saved file can be opened with PDFsharp.
If so, then most likely the original file is corrupt.

Author:  mohamed.m [ Tue Jun 26, 2018 7:40 am ]
Post subject:  Re: PDFsharp cannot open PDFFile

Hi Thomas,

I can open the pdf file in PDF Sharp after saving in adobe reader. I tried uploading the pdf but it threw an error stating unsupported image file.

Best Regards,
M. Mohamed Musthafa

Author:  Thomas Hoevel [ Tue Jun 26, 2018 9:08 am ]
Post subject:  Re: PDFsharp cannot open PDFFile

mohamed.m wrote:
I tried uploading the pdf but it threw an error stating unsupported image file.
You can upload a ZIP containing the PDF file.

mohamed.m wrote:
I can open the pdf file in PDF Sharp after saving in adobe reader.
So most likely a corrupted PDF file.

There are some pull requests on GitHub that are supposed to improve how PDFsharp handles corrupt files. They may or may not help with your case. Use at own risk.
https://github.com/empira/PDFsharp/pulls

Author:  Nalex_csu [ Wed Jun 27, 2018 8:00 am ]
Post subject:  Re: PDFsharp cannot open PDFFile

Hello!
I have the same problem.
Program opens a lot of files success but i have one of them with error.
When i try to open it i get a catch: "{"Token '18' was not expected."}"
This file didn't have any error when i open it by "Adobe Reader".

Code:
document = PdfReader.Open(fileName, ownerPassword.NullOrString() ?? userPassword.NullOrString());


PDF Sharp version : 1.50.4845-RC2a

I hope you can help me. If you can't use attach file I can send file with to e-mail.

Best Regards,
Alex

Attachments:
File comment: Error file
17654.zip [49.46 KiB]
Downloaded 379 times

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