We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Out of Memory Error Creating PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

51829 Nov 14,2006 07:11 PM Jul 2,2010 12:19 AM Windows Forms 10
loading
Tags: PDF
Lee Whitney
Asked On November 14, 2006 07:11 PM

Hello,

We are getting this error on a fast computer with 2GB RAM running XP.

Version of PDF Assembly is 4.202.0.27

The image is a bit large at 3600x3600, however GDI+ should not be the limiting factor on this.

Please help, thank you.


===================================
Out of Memory Exception at
System.Drawing.Image.FromFile(String filename, Boolean
useEmbeddedColorManagement) at System.Drawing.Image.FromFile(String
filename) at
Syncfusion.Pdf.Implementation.Utilities.Utils.TryLoadImage(String fileName) at Syncfusion.Pdf.Implementation.Utilities.PDFImagesFactory.CreateImage(String
imgPath) at
Syncfusion.Pdf.Implementation.Objects.PDFGraphics.DrawImage(PointF location, String fileName, SizeF destination, IPDFGraphicState properties, RectangleF
clipRectangle) at
Syncfusion.Pdf.Implementation.Objects.PDFGraphics.DrawImage(PointF location,
String fileName, SizeF destination)

Dhivya K [Syncfusion]
Replied On November 15, 2006 08:09 AM

Hi,

Thank you for your interest in Essential PDF. I tried creating a sample with 3600x3600 png image.I am afraid. I was unable to reproduce the issue.

Here is the sample for your reference
image.zip


Could you please provide me the image type[jpg or Tiff] or sample image with which you are able to reproduce this issue.This will help me investigating further on this issue.

Regards.
Dhivya.

Lee Whitney
Replied On November 28, 2006 07:55 PM

Hi Dhivya,

It seems this is the problem with SyncFusion PDF:

When creating a PDF document, every time a image is added it is loaded in memory and kept there until the document is completed.

So for example, if a 100 page document is created, and a large image is added to each page, then SyncFusion tries to keep all 100 images in memory at once.

This leads to out of memory errors, because .NET bitmaps (which Syncfusion uses) cannot take advantage of virtual memory.

To reproduce this problem, add new pages in a loop and draw a large .JPG on each page. When stepping through in the debugger you can see the memory is not released until the document is closed.

So my questions are now:

1) Is my understanding of the problem correct?

2) Is there anyway that the amount of memory can be reduced for many page documents?

This issue is quite urgent to our customers.

Thank you.

>Hi,

Thank you for your interest in Essential PDF. I tried creating a sample with 3600x3600 png image.I am afraid. I was unable to reproduce the issue.

Here is the sample for your reference
image.zip


Could you please provide me the image type[jpg or Tiff] or sample image with which you are able to reproduce this issue.This will help me investigating further on this issue.

Regards.
Dhivya.

Administrator [Syncfusion]
Replied On November 29, 2006 01:24 PM

Hi,

I tried creating a sample with 3600x3600 png image. In which, the image is drawn on every page up to hundred page. Hence, I am afraid. I was unable to reproduce the issue.

Here is the sample for your reference.
image.zip

Could you please take a look at this and let me if the problem still exists.

Regards,
Prakash.

Justin
Replied On November 1, 2007 05:45 AM

Hello,
This error can occur even when the image size is 0 bytes. i,e the file has a name and extension as *.jpg, but when you try to create a file from the path. the application throws this error. You can try for the images, what iam sending now.

>Hello,

We are getting this error on a fast computer with 2GB RAM running XP.

Version of PDF Assembly is 4.202.0.27

The image is a bit large at 3600x3600, however GDI+ should not be the limiting factor on this.

Please help, thank you.


===================================
Out of Memory Exception at
System.Drawing.Image.FromFile(String filename, Boolean
useEmbeddedColorManagement) at System.Drawing.Image.FromFile(String
filename) at
Syncfusion.Pdf.Implementation.Utilities.Utils.TryLoadImage(String fileName) at Syncfusion.Pdf.Implementation.Utilities.PDFImagesFactory.CreateImage(String
imgPath) at
Syncfusion.Pdf.Implementation.Objects.PDFGraphics.DrawImage(PointF location, String fileName, SizeF destination, IPDFGraphicState properties, RectangleF
clipRectangle) at
Syncfusion.Pdf.Implementation.Objects.PDFGraphics.DrawImage(PointF location,
String fileName, SizeF destination)


33301.zip

Rajarajeswari S [Syncfusion]
Replied On November 6, 2007 03:37 AM



Hi,

As this is suspected to be a defect, we have created a new Direct-Trac Incident ID 38863. Please follow this incident to get more information regarding the issue.

Regards,
Raji


Johan Lindvall
Replied On June 4, 2010 04:10 AM

Has this been fixed? I believe we are seeing the same (or a very similar) issue with 8.2.0.18.

Pravin Joshua D [Syncfusion]
Replied On June 8, 2010 04:49 AM

Hi Johan,

On further analysis of this issue its found that it is not the bug of Essential PDF. Even if we use .Net image class, it will also raise OutOfMemory exception. Since we are using .Net image class to render the image into Pdf, we are getting the exception which is raised by .Net.

To confirm this, please try the code as given below:

string path=@"..\..\App_Data\image2.jpg";
Image im = Image.FromFile(path);

This will raise outOfMemory exception and so this is not the issue of Pdf. This is the default behavior of .NET. Please have a look at the sample from the below link which illustrates this:

Sample:

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=CS-1166061123.zip

Please let us know if you have any questions.

Regards,
Pravin.

Johan Lindvall
Replied On June 8, 2010 08:28 AM

Pravin,

There seems to be a misunderstanding - the sample you just posted throws an OutOfMemoryException because the file is invalid (0 bytes long). This is not the issue we are seeing.

We are seeing the issue LW posted at 11/28/2006 7:55:41 PM, where SyncFusion PDF keeps all images in memory until the document is completed. Is this still the case?


Johan Lindvall
Replied On June 10, 2010 07:00 AM

I have opened Direct-Trac 68851 regarding this problem.

Pravin Joshua D [Syncfusion]
Replied On July 2, 2010 12:19 AM

Hi Johan,

Thank you for the update. We will continue our follow up in the mentioned direct trac incident.

Regards,
Pravin.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;