Pdf file size issue with workbook.save method

Hi Team,

I am using Smart Markers of Apsose.Cells(7.3.1.1) workbook.save method to save in pdf format.

While exporting output in excel the file size is only 50kb.

But, when we save the pdf file, the size of the file is too large( 8 page pdf file size is 190kb).

I have attached here excel input template file, Output in excel and pdf format.

How we can optimize/minimize the output pdf file size? Because, we need to send output pdf files to the clients through an email. And the file size is major concern for us.

Regards,

Navnath

Hi,


Thanks for the sample files.

I can notice the issue regarding file size, although it is not very significant regarding Pdf file size.

Sample code:

var wb = new Workbook(@“e:\test2\Outputinexcel.xlsx”);
PdfSaveOptions pso = new PdfSaveOptions(SaveFormat.Pdf);
pso.ImageType = ImageFormat.Png;
wb.Save(@“e:\test2\Outputinpdf.pdf”, pso);

I have logged a ticket with an id: CELLSNET-41096 for our investigation. We will look into it soon if we can enhance it more.

Thank you.


Hi Amjad,

Thanks for your quick reply.

I have tried with the above image type as png but using this output pdf size increaed slightly more.

I am suspecting that the pdf size is incresing due to the font embeding in pdf output.

So, is there any option through which we can avoid the font embeding while saving the pdf output?

I did one more research, that i have reduced the pdf output file size through pdf distiller reduce file size option. And the pdf file size compress to half of the original size(attched here).

Thanks and Regrds,

Navnath

Hi,


Thanks for providing us your feedback, sample file and further details.

I have logged it against your issue “CELLSNET-41096” in our database. We will soon look into it. Once we fix the issue or have any update on it, we will let you know here.

Thank you.

Hi again,


First of all, please accept our apologies for the delayed response on this thread.

Please use the latest version of Aspose.Cells for .NET 16.12.0 with following piece of code, which should produce a PDF of just 129 KB.

C#

Workbook wb = new Workbook(srcFile);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.OptimizationType = PdfOptimizationType.MinimumSize;
wb.Save(outFile.pdf, pdfSaveOptions);