DownsampleOptionsResolution Property

Specifies the resolution in pixels per inch which the images should be downsampled to.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public int Resolution { get; set; }

Property Value

Type: Int32
Remarks
The default value is 220 ppi.
Examples
Shows how to change the resolution of images in output pdf documents.
// Open a document that contains images 
Document doc = new Document(MyDir + "Rendering.docx");

// If we want to convert the document to .pdf, we can use a SaveOptions implementation to customize the saving process
PdfSaveOptions options = new PdfSaveOptions();

// This conversion will downsample images by default
Assert.True(options.DownsampleOptions.DownsampleImages);
Assert.AreEqual(220, options.DownsampleOptions.Resolution);

// We can set the output resolution to a different value
// The first two images in the input document will be affected by this
options.DownsampleOptions.Resolution = 36;

// We can set a minimum threshold for downsampling 
// This value will prevent the second image in the input document from being downsampled
options.DownsampleOptions.ResolutionThreshold = 128;

doc.Save(ArtifactsDir + "Document.DownsampleOptions.pdf", options);
See Also