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

Free Support Forum - aspose.com

PDF files much larger with Aspose

My company is planning on purchasing your product for an upcoming project. We will be converting a single TIFF and multiple JPEG files into a PDF. I am using the DEMO version of Aspose to test this. We are currently doing the same task with freeware ghostwriter software. I was able to successfully convert using Aspose but the issue is the images are much larger when created by Aspose instead of ghostwriter, gswin32c. One PDF image created by ghostwriter was 1,101 KB but 6,057 KB when created by Aspose. I tried to add optimization code that I found posted on your site but it did not reduce the pdf size. Can you give me any suggestions on how to reduce the size of the PDF file generated by Aspose? I stripped out the code and created standalone vb.net code of what I am doing and it is attached.

I did some more testing and found if I open the pdf file created by Aspose and then optimize and save the image size is much smaller. This takes too much time so I’m hoping there is a way to optimize pdf while creating.

Hi Wayne,


Thanks for using our API’s.

Can you please share the resource images (TIFF, JPEG etc) so that we can test the conversion in our environment. Please note that in order to have optimized output, you need to first place the images inside the PDF file and then call OptimizeResources(…) method. As per your scenario, once the images are placed inside PDF, you can save the output in temporary stream object and then instantiate a new Document instance from stream object and then call OptimizeResources(…) method.

I tried moving the OptimizeResources after placing images inside the PDF and right before I save but the image is still not optimized. I attached the example TIFF and JPEG files I am using to test. In the code, after I have saved the PDF, I instantiate a PDF document pointing to the PDF I have just created. When I optimizeResources and save the document gets optimized. Is there a way to optimize in the first save. Thanks for your assistance.

Hi Wayne,


Thanks for sharing the details.

I have tested the scenario and have observed that PDF file size is not optimized when saving in first attempt. However for
the sake of optimization, I have logged an enhancement it in our issue tracking system as
PDFNEWNET-38134. We will
investigate this issue in details and will keep you updated on the status of a
correction.

We apologize for your inconvenience.

is there any update on this issue? I have a similar issue where multiple TIF images getting merged into a single PDF yield a file many times larger than the sum of all the original TIF images.


In some cases where I’m putting 300+ tif images together (~3 mb each), it actually causes the server to become non-responsive in almost every way. if I am able to get the task manager open to view ram utilization, I see it bounce from a few megabytes to 95% of the ram (about 15.5 GB). It’s happening on the “pdf.Save(pdfStream)” where pdf is an aspose.pdf.generator.pdf object and pdfStream is the memory stream I added all the tif images to. I assume this ram bouncing around has to do with page saves of some sort.

I’ve left the process run several hours just to see if it would complete, but ultimately gave up.

I have an older version of Aspose, so I’m wondering if I need to talk the boss into upgrading to resolve this or if we’ve just hit a limit of aspose and need to look elsewhere for a solution.

thanks,

Carl

Hi Carl,


Thanks for contacting support.

The time taken by API to perform particular operation depends upon the structure of input files. However as per your scenario, can you please share your sample TIFF images, so that we can test the conversion in our environment. We are sorry for this inconvenience.

PS, in recent release versions, we have made many improvements in terms of PDF creation/manipulation but before we recommend you to upgrade to latest versions, we need to first test the scenario in our environment.