When opening a PDF file which is > 2GB in size, the following exception is thrown
Code:
Unhandled Exception: System.ArgumentOutOfRangeException: Non-negative number required.
Parameter name: value
at System.IO.FileStream.set_Position(Int64 value)
at PdfSharp.Pdf.IO.Lexer.ReadRawString(Int32 position, Int32 length)
at PdfSharp.Pdf.IO.Parser.ReadTrailer()
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider)
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, PdfDocumentOpenMode openmode)
From the stack trace it looks like PDFSharp internally is only working with 32bit ints which would lead to an overflow with this file size.