Resample Added Images - Excel to PDF Conversion
Contents
[
Hide
]
While working with big Microsoft Excel files with lots of images, you might need to compress images that have been added to reduce the output PDF file size and improve the overall conversion performance. Aspose.Cells for Python via .NET supports resampling added images to reduce the output PDF file size and improve the performance somewhat.
Please see the following sample code that describes how to perform the task using the Aspose.Cells for Python via .NET API. The example converts a Microsoft Excel file to a PDF file while compressing the images in the file.
Using the the PdfSaveOptions.set_image_resample option minimizes the size of the output PDF but it may affect the image quality a bit.
If your spreadsheet contains formulas, it is best to call Workbook.calculate_formula() just before rendering the spreadsheet to PDF format. Doing so will ensure that the formula dependent values are recalculated, and the correct values are rendered in the PDF.