We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

"Out of memory" exception when saving workbook as PDF (5 mb image grows PDF to 48 mb)

Hi team,

we’re getting an “out of memory” exception when saving an Excel workbook as PDF (to HttpContext.Current.Response or to local filesystem makes no difference).

If the sheet contains some small images (9 images with 140 kb alltogether) it generates a 730 kb PDF with no problem. With one bigger image (about 5 mb, 5.x mb alltogether), the generated PDF grows to 48 (!!!) mb and still works. With an 9 mb image (9.x mb alltogether) the PDF grows to more than 60 mb and we’re getting the “out of memory” exception. Why is the PDF growing that much???

PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.CalculateFormula = true;
workbook.Save(HttpContext.Current.Response, _destinationFileName, ContentDisposition.Attachment, pdfSaveOptions);

The OS is Windows 7, 32 bit; Aspose.Cells 7.5.2.0.

What can we do?
Thank you!

Hi,


Could you attach your template Excel file here, we will evaluate and check your issue on our end. If we found the issue, we will log a ticket for it into our database with all the details, so it could be analyzed and sorted out soon.

Thank you.

Images and template attached. Thank you.

Hi,


Thanks for sharing the template file and sample image files.

Could you share the sample code here or preferably a sample console application(runnable), you may zip it prior attaching here, we need to evaluate your sample code and investigate your issue on our end.

Thank you.

Console app attached. Try running as is - the save command hangs. When changing the first image (9 mb) to a smaller one (some kb), it works. Do also have a look at the memory consumption (task manager hardcopy).

Thank you.

Hi,

Thanks for sharing the sample project with the template file.

After an initial test, I can notice the issue as you mentioned by using your sample project with your template file. We have seen that you just inserted a big image file (9MB in size) into the cell and save to PDF format. First, it tries to take long time to complete the process, the CPU usage was really high and also, it took more memory (RAM). After some minutes (time), I got "Out of memory." exception on Workbook.Save() method. We need to investigate the issue on our end. I have logged a ticket with an id "CELLSNET-41952" for your issue. We will look into your issue soon.

Once we figure your issue out or we have some other updates on it, we will let you know here.

Thank you.

Hi,

are there any updates on this issue? It blocks our generating of PDFs.

Thank you.

Hi,


I have checked the status in our database , I am afraid your issue “CELLSNET-41952” is still open and not resolved yet. However, I have asked the relevant developer to update on it or share an era (if possible).

Once we receive an update on it, we will let you know here.

Thank you.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.1.2.2 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-41952) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as CELLSNET-41952) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(1)

Hi,

I don’t know why but we are having this problem again, this time with even much smaller images (< 350 kb) - using smaller images was our workaround since my initial post. A 500 kb Excel file grows to a 2500 kb pdf, an 2 mb Excel file grows to a 20(!) mb pdf. That happens only sometimes, but in about 75 % of all cases.

I tried to use the version in which you fixed the problem but run into a licence out of date issue. Our customer cannot buy another expensive prolonging for just fixing this issue. What can we do?

Regards
Ingo

Hi,


Sorry for fixing the issue late but we normally have a very busy schedule throughout the year. We also give more priority to Priority issues (the issues posted by the clients who purchased Priority/ Enterprise Support). Sometimes an issue gets fixed quickly but in some cases, we take more time to fix the issue. This also depends upon the complexity of the issue which surely takes more resources and time in fixing the problems. Anyways, we request you to kindly give the latest version/fix a try, you may test it in a separate application and comment out the licensing codes etc., this way, you would be able to check if the latest version fixes your issues or not. If the latest version fixes your issue, then you may upgrade to latest version. I am afraid, there is no other option but to upgrade to latest version if you need a fix for your issue. Moreover, if, after upgradtion to latest version, you still find any issue, we are bound to fix that issue. And, we are sorry but we can fix issues based on the latest code base, we cannot fix any issue in older versions of the product.

Thanks for your understanding!

Hi,

with v8.1.2.2 (we are using 7.5.2.0) the file size went down from about 20 mb to 3.9 mb which is not bad. But exporting the xlsx as pdf from within Excel produces a pdf with 600 kb only!

Anyway - some thousand $ for a fix is no option for us. What do we do if the next issue comes up and the licence period is over again?! Btw - we have another confirmed issue pending since 1,5 years (see 466948 in reply to 466944) - no solution yet! It’s really not much we need - inserting images, image transparency (the other still opened issue) and exporting as pdf, but we feel quite left alone now.

I understand very well that you can’t fix issues in older versions but forcing customers to fully pay an update which is not needed - except of the fix(es) - is a really bad business practice. I am forced to evaluate DevExpress now - we are getting the full all in one package (including all controls and document generation for all platforms) for the same price like your fix update …

Regards
Ingo

Hi Ingo Bleile,


We are very sorry for the inconvenience caused to you. Generally, we try our level best to support customer needs and fix their issues in short time. But sometimes, a few complex issues take more time than we initially anticipated. We still wish you could use our products in your scenarios.

Regarding your other issue “CELLSNET-41690” posted in your other thread( <a href="https://forum.aspose.com/t/95563), this issue is re-scheduled and hopefully it will be fixed soon.


Thank you.