Hi,
I've got an app where I'm joining together multiple PDF documents - this is working fine for the most part, but I am encountering some PDF documents that are causing it to generate an OutOfMemory exception.
I'm using PDFSharp 1.50 beta, and have a skeletal app illustrating the problem at
https://github.com/leighghunt/pdfsharp-test.
Has anyone else encountered this error - I assume it is to do with the "some files" alluded to by Thomas at
viewtopic.php?f=2&t=3017:
Quote:
This works with many files, but some files still cause exceptions when you open them with PDFsharp.
An example of the error log is below.
Does anyone know of a workaround, or where perhaps I can download the source for 1.50 beta to investigate further?
Code:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Text.StringBuilder.ExpandByABlock(Int32 minBlockCharCount)
at System.Text.StringBuilder.Append(Char value, Int32 repeatCount)
at System.Text.StringBuilder.Append(Char value)
at PdfSharp.Pdf.IO.Lexer.AppendAndScanNextChar()
at PdfSharp.Pdf.IO.Lexer.ScanName()
at PdfSharp.Pdf.IO.Lexer.ScanNextToken()
at PdfSharp.Pdf.IO.Parser.ScanNextToken()
at PdfSharp.Pdf.IO.Parser.ReadObject(PdfObject pdfObject, PdfObjectID objectID, Boolean includeReferences, Boolean fromObjecStream)
at PdfSharp.Pdf.IO.Parser.ReadCompressedObject(Int32 objectNumber, Int32 offset)
at PdfSharp.Pdf.Advanced.PdfObjectStream.ReadCompressedObject(Int32 index)
at PdfSharp.Pdf.IO.Parser.ReadCompressedObject(PdfObjectID objectID, Int32 index)
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider)
at PdfSharp.Pdf.IO.PdfReader.Open(String path, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider)
at PdfSharp.Pdf.IO.PdfReader.Open(String path, PdfDocumentOpenMode openmode)
at PDFTest.Program.JoinPDFDocuments(List`1 PDFFilePaths) in c:\Users\Administrator\Documents\Leigh\pdfsharp-test\PDFTest\Program.cs:line 44