Closed iquirino closed 1 year ago
It should be noted that PR only handles one condition in which this exception can occur, does not fix all non-negative number errors
I work with thousands pdf in a day. This one is the only non negative exception tha i have catched.
I think it can be merged... And then you can solve other point... ?
Is clear to me that idx validation need to be inside of startxref var instantiation
Sorry @iquirino didn't mean to be rude, I actually am tracking down a dictionary read error on opening a PDF from an online system. It also generates this error and between this pr AND #95 I was hoping one of them addressed i (as pdfs open fine in acrobat). Sadly not.
My warning was just to others that this may not resolve all the stream seek isues.
PdfSharp-wpf.dll!PdfSharp.Pdf.IO.Lexer.Position.set(int value) Line 71 C#
PdfSharp-wpf.dll!PdfSharp.Pdf.IO.Parser.MoveToObject(PdfSharp.Pdf.PdfObjectID objectID) Line 80 C#
> PdfSharp-wpf.dll!PdfSharp.Pdf.IO.Parser.ReadObject(PdfSharp.Pdf.PdfObject pdfObject, PdfSharp.Pdf.PdfObjectID objectID, bool includeReferences, bool fromObjecStream) Line 121 C#
PdfSharp-wpf.dll!PdfSharp.Pdf.IO.Parser.GetStreamLength(PdfSharp.Pdf.PdfDictionary dict) Line 317 C#
PdfSharp-wpf.dll!PdfSharp.Pdf.IO.Parser.ReadStream(PdfSharp.Pdf.PdfDictionary dict) Line 287 C#
PdfSharp-wpf.dll!PdfSharp.Pdf.IO.Parser.ReadObject(PdfSharp.Pdf.PdfObject pdfObject, PdfSharp.Pdf.PdfObjectID objectID, bool includeReferences, bool fromObjecStream) Line 269 C#
PdfSharp-wpf.dll!PdfSharp.Pdf.IO.PdfReader.Open(System.IO.Stream stream, string password, PdfSharp.Pdf.IO.PdfDocumentOpenMode openmode, PdfSharp.Pdf.IO.PdfPasswordProvider passwordProvider) Line 433 C#
PdfSharp-wpf.dll!PdfSharp.Pdf.IO.PdfReader.Open(string path, string password, PdfSharp.Pdf.IO.PdfDocumentOpenMode openmode, PdfSharp.Pdf.IO.PdfPasswordProvider provider) Line 216 C#
PdfSharp-wpf.dll!PdfSharp.Pdf.IO.PdfReader.Open(string path, PdfSharp.Pdf.IO.PdfDocumentOpenMode openmode) Line 186 C#
testParse.dll!testParse.MainWindow.MainWindow_Loaded(object sender, System.Windows.RoutedEventArgs e) Line 51 C#
PR #95 will solve this issue too or you need to replicate this in PR #95?
Fixed in current internal builds of PDFsharp.
Thank you! ;)
_lexer.Position = -1 cause System.IO.MemoryStream.set_Position to be -1. https://imgur.com/a/hy8TKdu