OutOfMemoryException convering to pdf

1 Answer 79 Views
PdfProcessing
Claude
Top achievements
Rank 1
Iron
Veteran
Claude asked on 13 Jun 2021, 02:14 PM

I am attaching a simple sample app to show the problem.  I have an app that makes a catalog of images.  somewhere between 4000 and 4500 images, the docx is created, but I get an OutOfMemoryException when creating the pdf.  Also if the pdf is created, it is larger than the docx.  The docx was around 483MB.  

in the app load an image (one is provided), select number of images from spineditor and hit create catalog button and wait for the process to complete.  

1. why is pdf larger than docx

2. What to do about the OutofMemoryException.

I have clients that will have > 10,000 images.  

 

app if too large to attach (46MB)

 

temp link to dropbox is here:  https://www.dropbox.com/t/0gHCjVvo2gNNN3id

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 16 Jun 2021, 03:55 AM

Hello Claude,

Thank you for sharing the sample project. This helped me to reproduce the described behavior.

  1. The difference in the size of the PDF and DOCX documents comes from the difference in the structure of the documents. Into both documents are inserted the same images with the same image size, but the other document elements make the difference.
  2. The OutOfMemoryException exception is thrown because the cumulative amount of the size of all images imported as ImageSource exceeds the maximum memory limits for 32-bit applications. I could suggest creating a 64-bit application or if this is not an option for your scenario, to set a limit on the size and the number of the images imported in a single document.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
PdfProcessing
Asked by
Claude
Top achievements
Rank 1
Iron
Veteran
Answers by
Martin
Telerik team
Share this question
or