Reduce pdf file size to less than 250 kb

Hi all,

Im wondering how i can reduce the pdf size under 250 kb

I found out this code example

`optimizeOptions.LinkDuplcateStreams = true;
        optimizeOptions.RemoveUnusedObjects = true;
        optimizeOptions.RemoveUnusedStreams = true;
        optimizeOptions.MaxResoultion = 150;
        optimizeOptions.ImageCompressionOptions.ImageQuality = 10;
        optimizeOptions.ImageCompressionOptions.CompressImages = true;
        optimizeOptions.ImageCompressionOptions.MaxResolution = 150;
        optimizeOptions.ImageCompressionOptions.ResizeImages = true;
        optimizeOptions.ImageCompressionOptions.Version = ImageCompressionVersion.Fast;
        pdfDocument.OptimizeResources(optimizeOptions);` 

but i dont really get the wanted result

any other solution ?

thank you in advance

@aamiour10675

Can you please share your sample PDF with us so that we can test the scenario in our environment and address it accordingly.

Hi @asad.ali

Thank you for reply , i’m working with several confidential customer document different size each time, so i wanna know if there is a way to handle this scenario with aspose library , i already attached the code i use

thank you again

@aamiour10675

Please note that it is not possible to shrink a document down to a particular and fixed file size without loosing its content and quality. However, you can use above code snippet with different settings and values in order to reduce the file size at its maximum possible capacity which will vary from document to document.