PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu May 02, 2024 4:47 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Jun 15, 2015 12:16 am 
Offline

Joined: Mon Jun 15, 2015 12:08 am
Posts: 5
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 15, 2015 7:40 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3097
Location: Cologne, Germany
Hi!

You cannot download the current 1.50 source code (yet).

You can submit your PDF file for inspection. Does the skeletal application include a PDF file that causes this exception?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 15, 2015 8:08 am 
Offline

Joined: Mon Jun 15, 2015 12:08 am
Posts: 5
Hi Thomas,

Thanks for the quick reply. Yep, the problem PDF is in project and will be loaded during the test.

You can also download it directly here: https://github.com/leighghunt/pdfsharp- ... lesome.pdf

I have one or two other example files that are not in the project - let me know if you'd like me to add them.

Cheers,
Leigh.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 22, 2015 11:25 pm 
Offline

Joined: Mon Jun 15, 2015 12:08 am
Posts: 5
Hi again Thomas,

We've encountered another document causing a problem - I've updated the skeletal project with a copy of the file: https://github.com/leighghunt/pdfsharp- ... some-2.pdf.

Do you have any indication of the cause of the issue, or any possible workaround?

Cheers,
Leigh.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 02, 2015 2:59 am 
Offline

Joined: Mon Jun 15, 2015 12:08 am
Posts: 5
Hi Thomas,

Let me know if there is anything I can do to help, or if you can give me a copy of the source to try and identify the issue.

Or even if it looks like a bug that isn't likely to be fixed.

Cheers,
Leigh.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 21, 2015 11:48 pm 
Offline

Joined: Mon Jun 15, 2015 12:08 am
Posts: 5
Awesome - the latest version 1.50.3915-beta2 now resolves the issue.

Thanks for your work Thomas.

Cheers,
Leigh.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 60 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group