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

Failed to open PDF file
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3644
Page 1 of 1

Author:  Marat [ Tue Aug 22, 2017 1:13 pm ]
Post subject:  Failed to open PDF file

Hi,

I receive the following exception when I'm trying to open PDF file:
Quote:
Unexpected token 'xref' in PDF stream. The file may be corrupted. If you think this is a bug in PDFsharp, please send us your PDF file.


Here is the file which I'm trying to open: https://www.dropbox.com/s/3076hz16l19wcys/File.pdf

Author:  Thomas Hoevel [ Tue Aug 22, 2017 2:23 pm ]
Post subject:  Re: Failed to open PDF file

Hi!

I think the file is corrupt. The XREF table should contain a list to the objects of the PDF. In this case the XREF table includes a link to the XREF table (which is not an object and thus PDFsharp finds "xref" where it expects two integers).

Adobe Reader is better when it comes to dealing with corrupt files. Open the file with Adobe Reader, select "Save As" and the new file works with PDFsharp.

Author:  Marat [ Tue Aug 22, 2017 3:59 pm ]
Post subject:  Re: Failed to open PDF file

Thank you.

Author:  Marat [ Mon Aug 28, 2017 12:10 pm ]
Post subject:  Re: Failed to open PDF file

Could you tell me whether this file has any issues?
https://www.dropbox.com/s/41youfiu0726v ... b92e8b.pdf

When I'm processing this file by using PDFSharp Family name is lost:

Code:
            using (var pdf = PdfReader.Open(inputPdf)) {
                ...
                pdf.Save(outputPdf);
            }

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