set_image_resample method

set_image_resample

Sets desired PPI(pixels per inch) of resample images and jpeg quality.
All images will be converted to JPEG with the specified quality setting, and images that are greater than the specified PPI (pixels per inch) will be resampled.

def set_image_resample(self, desired_ppi, jpeg_quality):
    ...
ParameterTypeDescription
desired_ppiintDesired pixels per inch. 220 high quality. 150 screen quality. 96 email quality.
jpeg_qualityint0 - 100% JPEG quality.

Example

The following code sets desired PPI as 96 and jpeg quality as 80 for images in the output pdf.

from aspose.cells import PdfSaveOptions, Workbook

# load the source file with images.
wb = Workbook("Book1.xlsx")
pdfSaveOptions = PdfSaveOptions()
# set desired PPI as 96 and jpeg quality as 80.
pdfSaveOptions.set_image_resample(96, 80)
wb.save("output.pdf", pdfSaveOptions)

See Also