PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Aug 19, 2018 11:24 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed May 16, 2018 9:36 am 
Offline

Joined: Mon Mar 20, 2017 1:08 pm
Posts: 4
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


Top
 Profile  
Reply with quote  
PostPosted: Wed May 16, 2018 10:11 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2847
Location: Cologne, Germany
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

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 25, 2018 3:21 pm 
Offline

Joined: Mon Jun 25, 2018 2:55 pm
Posts: 2
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 25, 2018 3:42 pm 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2847
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 26, 2018 7:40 am 
Offline

Joined: Mon Jun 25, 2018 2:55 pm
Posts: 2
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 26, 2018 9:08 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2847
Location: Cologne, Germany
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

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 27, 2018 8:00 am 
Offline

Joined: Wed Jun 27, 2018 7:05 am
Posts: 1
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 12 times
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group