PdfSaveOptions.ImageCompression

PdfSaveOptions.ImageCompression property

Gets or sets the type of compression applied to images in the PDF file.

public PdfImageCompression ImageCompression { get; set; }

Examples

Shows how to save a document in pdf format using specific settings.

// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

// Load the document into Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");

// Initialize PdfSaveOptions object
PdfSaveOptions opts = new PdfSaveOptions
                          {
                              // Use Jpeg compression
                              ImageCompression = Saving.Pdf.PdfImageCompression.Jpeg,

                              // Quality for JPEG compression
                              JpegQuality = 90
                          };

dataDir = dataDir + "Document.SaveWithOptions_out.pdf";
doc.Save(dataDir, opts);

See Also