Skip to content

EOF problem with file. #822

@kingkej

Description

@kingkej

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions