We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Optimize doesn't reduce file size

I’m evaluating several PDF optimization products, Aspose is the only vendor that I’ve tried that is actually increasing the PDF size!

The original file size is 322KB.
testdoc.PDF (321.1 KB)

Using just document.Optimize() and saving, the file size increases to 351KB.
Using the document.OptimizeResources() with ImageQuality = 10 (terrible quality!), the file size is 342KB.

For reference, Adobe Acrobat can save this file as 252KB with no appreciable loss in image quality.

I understand there are some watermarks being added in the trial version, etc… but that alone can’t account for the increase! What’s going on here? Is there a different way of doing this I should be testing? This isn’t a composite document with multiple text blocks etc., it’s just a big scanned image.

Thanks for any help you can offer!

@mgaudet

Thanks for using our API.

I have tested the scenario while using Aspose.Pdf for .NET 17.7 with a valid license and observed that file size reduced to 313KB. Please check following code snippet which I have used to optimize your PDF document. For your reference, I have also attached a resultant file by below code snippet.

Document pdf = new Document(dataDir + "testdoc.pdf");
pdf.OptimizeResources(new Document.OptimizationOptions()
{
 LinkDuplcateStreams = true,
 RemoveUnusedObjects = true,
 AllowReusePageContent = true,
 RemoveUnusedStreams = true,
 UnembedFonts = false,
 CompressImages = true,
 ImageQuality = 10,
 ResizeImages = true
});
pdf.Save(dataDir + "testdoc_out2.pdf"); 

testdoc_out_optimizeresources.pdf (312.5 KB)

Furthermore, when I tried to optimize the document using only Optimize() method, the PDF size did not change neither increased. However, I have logged a quality issue as PDFNET-43068 in our issue tracking system, for the sake of detailed investigation. I have also provided the details regarding Adobe Reader Optimization results, which you have shared, with the issue.

Please note that you can apply for a Temporary License over our website to evaluate complete features of our API without any restrictions. As far as, above logged issue is concerned, as soon as we receive some updates from our product team in this regard, we will inform you within this forum thread. Please be patient and spare us little time.

We are sorry for the inconvenience.