Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Oct 06, 2026 11:57 am

I'm trying to compress .pdf file of size 3MB using following code:

Code: Select all
        PdfCompressor compressor = new(src);

        compressor.Options.TextCompressionOptions.CompressFonts = true;
        compressor.Options.TextCompressionOptions.UnembedFonts = true;

        compressor.Options.ImageCompressionOptions.CompressImage = true;
        compressor.Options.ImageCompressionOptions.ResizeImages = true;

        compressor.CompressToFile(dest);


But result in my case is very poor, only couple of percents.

When I uploaded the same file to ilovepdf.com cloud service, it compressed it 98%.
Is there a way to compress this file with similar result in SpirePdf?

I can't attach example file as it exceeds 2MB upload limit.
Is there another way to provide you my example?

bbrodnik
 
Posts: 21
Joined: Sat Jan 09, 2021 10:38 am

Wed Oct 07, 2026 3:38 am

Hello,

Thank you for your inquiry.

Could you please confirm whether you are using the latest version, Spire.PDF Version 12.9.18? If not, we recommend updating to this version and giving it another try. In addition, we offer further options for document compression settings, please refer to the following help documentation and try applying them:https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Document-Operation/How-to-Compress-PDF-Document-in-C-VB.NET.html.

If you have already tested all of the above and still find that the compression ratio is not high enough, please email your PDF document to [email protected] so that we can help investigate further. Thank you for your support.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3052
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF