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

Free Support Forum - aspose.com

Merging PDFs and file size

I am testing out this PDF api for a new project. I have one large PDF (1000+ pages), and a second, smaller PDF (34 pages). What I need to do is loop through the large PDF, and after every 10 pages, insert the small one. I then need to save the resulting PDF to a new file (4400+ pages).

The code to accomplish this is easy enough, and it runs very quickly. My problem however, is the resulting file size. I would expect a properly optimized PDF to store those 34 pages as a resource and simply reference it, but it seems the API is writing the same pages to the file all 100 times. So if the first PDF is 60MB, and the second is 1MB, I would expect the result to be around 61MB, instead, it is 160MB.

Is there some way I can save the output as an optimized PDF?

Hi Aaron,

Thanks for contacting support.

In order to optimize the size of resultant PDF, you may consider following the instructions specified over Optimize PDF file size

In case the problem still persists, please share the resource files so that we can further look into this matter. We are sorry for this inconvenience.

PS, in order to share the large files, you may consider uploading them to some free FTP and share the link.