Click or drag to resize
PdfImageCompression Enumeration
Specifies the type of compression applied to images in the PDF file.

Namespace: Aspose.Words.Saving
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
Syntax
public enum PdfImageCompression
Members
  Member nameValueDescription
Auto0 Automatically selects the most appropriate compression for each image.
Jpeg1 Jpeg compression. Does not support transparency.
Examples
Shows how to save images to PDF using JPEG encoding to decrease file size.
Document doc = new Document(MyDir + "SaveOptions.PdfImageCompression.rtf");

PdfSaveOptions options = new PdfSaveOptions
{
    ImageCompression = PdfImageCompression.Jpeg,
    PreserveFormFields = true
};
doc.Save(ArtifactsDir + "SaveOptions.PdfImageCompression.pdf", options);

PdfSaveOptions optionsA1B = new PdfSaveOptions
{
    Compliance = PdfCompliance.PdfA1b,
    ImageCompression = PdfImageCompression.Jpeg,
    JpegQuality = 100, // Use JPEG compression at 50% quality to reduce file size
    ImageColorSpaceExportMode = PdfImageColorSpaceExportMode.SimpleCmyk
};

doc.Save(ArtifactsDir + "SaveOptions.PdfImageComppression PDF_A_1_B.pdf", optionsA1B);
See Also