Excessive Sized PDF file when using small images in Excel source

We're using Aspose Cells 7.2.2.1 to generate PDF (and Excel) files. When adding small JPG images to the source XLS and generating a PDF through ASPOSE the file is 6 times the size of the source XLS. I appreciate that ASPOSE does not adjust the image size when generating a PDF, but the image in question is an 11KB JPG file.

Why is the PDF so big? It is a single sheet Excel file (70KB) with an image (11KB) generating a PDF of 420KB.

I attach the source XLS file, the image used in the XLS (as a separate file), the XLS generated from ASPOSE and finally the PDF generated by ASPOSE.

Hi,

Thanks for sharing the files.

I can notice the size issue when converting your Excel file (containing the image) to PDF as you pointed out.

Sample code:

String path ="Image_Problems_Aspose_Generated_XLS.xls";
Workbook workbook = new Workbook(path);

PdfSaveOptions pso = new PdfSaveOptions(SaveFormat.PDF);
pso.setImageType(com.aspose.cells.ImageFormat.getGif());

workbook.save(path + ".out.pdf", pso);

We will look into it and we will get back to you soon.

I have logged a ticket with an id: CELLSJAVA-40277 for your issue. The issue is linked with the thread, so once we figure it out, you will be notified here automatically.

Thank you.
Hi,

Sorry for getting back to you late.

We did fix your issue in newer versions of the product. We recommend you to kindly upgrade to and try our latest version/fix: Aspose.Cells for Java v16.12.0, it would fix your issue:

Using the new version, the the size of generated PDF is about 122 KB.

Thank you