PdfPig icon indicating copy to clipboard operation
PdfPig copied to clipboard

EOF problem with file.

Open kingkej opened this issue 1 year ago • 0 comments

Hi everyone! Been using PdfPig for a while now. I really enjoy working with this awesome library. I would like to report an issue I've ran while using it.

Unexpected token following xref and 8637681. We found: %EOF.

at UglyToad.PdfPig.Parser.FileStructure.CrossReferenceTableParser.Parse(ISeekableTokenScanner scanner, Int64 offset, Boolean isLenientParsing)

at UglyToad.PdfPig.Parser.FileStructure.CrossReferenceParser.Parse(IInputBytes bytes, Boolean isLenientParsing, Int64 crossReferenceLocation, Int64 offsetCorrection, IPdfTokenScanner pdfScanner, ISeekableTokenScanner tokenScanner)

at UglyToad.PdfPig.Parser.PdfDocumentFactory.OpenDocument(IInputBytes inputBytes, ISeekableTokenScanner scanner, InternalParsingOptions parsingOptions)

at UglyToad.PdfPig.Parser.PdfDocumentFactory.Open(IInputBytes inputBytes, ParsingOptions options)

at UglyToad.PdfPig.Parser.PdfDocumentFactory.Open(Stream stream, ParsingOptions options)

at UglyToad.PdfPig.PdfDocument.Open(Stream stream, ParsingOptions options)

Firstly, I have tried to remove EOF from byte array of this file, but that made this file unreadable. Then I have checked this file in VSCode. As you can see there are many EOFs. After that I have simply deleted last page of this file in PDF Preview and PdfPig managed to open this file. However, PdfSharp library could open this file without any edition. image FileData_7.pdf

kingkej avatar Apr 23 '24 18:04 kingkej