Hi Tilal,
Ok. Let me explain. We have a PDF test file which original size is 26M. This has 8 pages. Our process consist in split the original file in smaller files (2 pages PDF file). When I got the 2 pages PDF and call the method OptimizeResources, the final file size is 26M, same than original file. With this situation, I created a post asking about this, the link is <a href=". In this post I pasted the code that I’m using and a “workaround” that I implemented to decrease the file size, which consist in replacing the images. Applying this process, the final PDF has a size of 2.5M. If you see the code (from the link), when the app replaces the image, I’m using the Save method from XImage class, which allows to save the image in a stream and specify a resolution, I was playing changing the ImageFormat and several resolutions but the final size is 2.5M, so, there isn’t any difference changing ImageFormat and resolution.
Now, when I changed to other library, PDFNet, it has a class where you can set up some optimization settings for images (color, gray and mono), something similar to Acrobat Pro Optimizer:
* CompressionMode (similar to ImageFormat)
* Downscale (DPI)
If image is greater than some value, downscale to this other value
Configuring the optimizer settings and using PDFNet, the final file size is around 800K, which is a big difference comparing to 2.5M.
After this, I opened the PDF in a text editor and I saw that for example, PDFNet has this:
<</BitsPerComponent 8/ColorSpace 44 0 R/DecodeParms [<</Colors 3/Columns 1050/Predictor 2>>]/Filter [/LZWDecode]/Height 24/Length 3475/Subtype /Image/Width 1050>>
And Aspose this:
<</ColorSpace/DeviceRGB/Subtype/Image/Length 1252/BitsPerComponent 8/Type/XObject/Width 1050/Filter/DCTDecode/Height 24>>stream
Is there a way to configure some settings in order to downscale the image? Or other approach to get better results in the final PDF file size?
Let me know if you have any doubt or question.
Regards,
Luis.