PdfSaveOptionsInterpolateImages Property

A flag indicating whether image interpolation shall be performed by a conforming reader. When false is specified, the flag is not written to the output document and the default behaviour of reader is used instead.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.11.0

ExpandedSyntax

public bool InterpolateImages { get; set; }

Property Value

Type: Boolean

ExpandedRemarks

When the resolution of a source image is significantly lower than that of the output device, each source sample covers many device pixels. As a result, images can appear jaggy or blocky. These visual artifacts can be reduced by applying an image interpolation algorithm during rendering. Instead of painting all pixels covered by a source sample with the same color, image interpolation attempts to produce a smooth transition between adjacent sample values.

A conforming Reader may choose to not implement this feature of PDF, or may use any specific implementation of interpolation that it wishes.

The default value is false.

ExpandedExamples

Shows how to improve the quality of an image in the rendered documents.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Image img = Image.FromFile(ImageDir + "Transparent background logo.png");
builder.InsertImage(img);

PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.InterpolateImages = true;

doc.Save(ArtifactsDir + "PdfSaveOptions.InterpolateImages.pdf", saveOptions);
Shows how to improve the quality of an image in the rendered documents (.NetStandard 2.0).
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

using (Image image = Image.Decode(ImageDir + "Transparent background logo.png"))
{
    builder.InsertImage(image);
}

PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.InterpolateImages = true;

doc.Save(ArtifactsDir + "PdfSaveOptions.InterpolateImages.pdf", saveOptions);

ExpandedSee Also