Unable to optimize Image Only Scanned PDF

We have constraint with PDFs shared with partners which cannot be over 200K per page, we are trying to optimize image Only Scanned PDF with Aspose.PDF with no success.

ScannedPDF, Sample1.pdf ”, 2 pages , 2 images , 715 136 bytes , images shown with poppler

page num Type width height Color comp bpc enc interp object ID x-ppi y-ppi size ratio
1 0 image 2480 3507 Gray 1 8 image no 16 0 300 300 655K 7.7%
2 1 image 2480 3507 Gray 1 8 image no 18 0 300 300 35.2K 0.4%
ScannedPDF, Sample1, Compressed, with Apose.pdf (697.5 KB)
ScannedPDF, Sample1, Compressed, with LovePDF.pdf (116.2 KB)
ScannedPDF, Sample1.pdf (698.4 KB)
ScannedPDF, Sample2, Compressed, with Apose.pdf.pdf (1.1 MB)
ScannedPDF, Sample2.pdf (1.1 MB)

Code used to optimize PDF.

License lic = new License();

lic.SetLicense(fileName);

using (var doc = new Document(fileName))

{

var optimizeOptions = new OptimizationOptions

{

LinkDuplcateStreams = true,

RemoveUnusedObjects = true,

RemoveUnusedStreams = true,

AllowReusePageContent = true

};

optimizeOptions.ImageCompressionOptions.CompressImages = true;

optimizeOptions.ImageCompressionOptions.ResizeImages = true;

optimizeOptions.ImageCompressionOptions.MaxResolution = 150 ;

optimizeOptions.ImageCompressionOptions.ImageQuality = 20 ;

doc.OptimizeResources(optimizeOptions);

doc.Save(compressFileName);

}

Results after compression, 714 207 bytes , less 0,13% and the images are still with 300 ppi with no compression 83% less .

page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio
1 0 image 2480 3507 gray 1 8 image no 16 0 300 300 655K 7.7%
2 1 image 2480 3507 gray 1 8 image no 18 0 300 300 35.2K 0.4%

If we use a simple tool like LovePDF , we get results 119 031 bytes, less c:

page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio
1 0 image 1240 1754 gray 1 8 jpeg no 8 0 150 151 111K 5.2%
2 1 image 1240 1754 gray 1 8 jpeg no 16 0 150 151 2397B 0.1%

Please advise how to proceed.

TIA,

Pedro

@luzsaude

We have logged an issue as PDFNET-49000 in our issue management system for further investigation on this scenario. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

We are giving up, feels like we throw away money, moving to other library.

@luzsaude

We really regret to see you making such decision. However, we would like to share with you that we resolved each reported issue. The resolution time of the issue depends upon various factors e.g. support model under which it was logged, complexity and nature of it, etc. You issue was logged recently on Nov 03, 2020 under free support model where issues are investigated and resolved on first come first serve basis.

Nevertheless, we have recorded your concerns and will surely consider them during issue investigation and make improvements to the API to perform better in such scenarios. We will post an update here as soon as we have some regarding ETA of issue resolution/fix.

We apologize for the inconvenience caused.