Hi
Hello DJ,
Thanks for contacting support.
Usually when you add images inside PDF document with Aspose.Pdf for .NET, the API does not compromise on image quality and to retain that image quality, it also keeps graphics state of image stored. Nevertheless you can optimize a PDF document using OptimizeResources() method of Document Class, which will compress images using CompressImages and ImageQuality. Please check following code snippet to optimize PDF resources.
Document pdf = new Document(dataDir + “input.pdf”);
pdf.OptimizeResources(new Document.OptimizationOptions()
{
LinkDuplcateStreams = true,
RemoveUnusedObjects = true,
RemoveUnusedStreams = true,
CompressImages = true,
ImageQuality = 10
});
pdf.Save(dataDir + "Output.pdf");
You may also check “Optimize PDF Document” in our API documentation, for more information. In case if you still face any issue, please share some more details i.e sample input document, sample image, sample code snippet which you are using to add image, so that we can try to test the scenario in our environment and address it accordingly.
Best Regards,