Hi,
I am using Aspose.PDF v18.11.0 and also with the latest version v19.10.0 with the below code snippet for Document Optimization
var optimizationOptions = new Aspose.Pdf.Optimization.OptimizationOptions();
optimizationOptions.RemoveUnusedObjects = true;
optimizationOptions.RemoveUnusedStreams = true;
optimizationOptions.AllowReusePageContent = true;
optimizationOptions.LinkDuplcateStreams = true;
optimizationOptions.UnembedFonts = true;
optimizationOptions.ImageCompressionOptions.CompressImages = true;
optimizationOptions.ImageCompressionOptions.ImageQuality = 50;
optimizationOptions.ImageCompressionOptions.ResizeImages = true;
pdfDocument.OptimizeResources(optimizationOptions);
in_original.pdf (64.3 KB)
out.pdf (46.8 KB)
I am using this code to compress the PDF document size after stripping off any possible Javascripts in the PDF document. It works on almost all documents and scenarios until I encountered with the attached document. It seems there are some issues with this code as the input document after getting processed is resulting in blackened output document. No error messages are thrown either. Attaching both input and output document for reference
Please let me know if you have resolved this issue or there is a workaround for such document compression without resulting in failure scenarios