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

Free Support Forum - aspose.com

What compression options are available when saving PDFs

Hi,

Currently I am using Aspose.Words for .Net version 9.5.0.0 in my application. I want to know below details.

1. Is it possible to apply any of the compression type while converting word documnet to PDF using Aspose.Words.dll in C#.Net application.

2. What are all the compression options are available when saving Word document to PDF.

3. How to apply compression type while converting Word document to PDF.

I need above details for

  • Excel document to PDF conversion using Aspose.Cells.dll for .Net version 5.2.2.1 in C# application and
  • PowerPoint document to PDF conversion using Aspose.Slides.dll for .Net version 5.0.1.0 in C# application as well.

Thanks,

Dhivya

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I think, there is no difference, which method of compression you use. Size of PDF documents can be reduced only by doing the following:

1. Decreasing size of images inside PDF (this can be done only be decreasing quality).

2. Subseting fonts, which are embedded into the PDF documents. (Aspose.Words does this by default).

3. Compression of text (Usually decreasing of size is not very big)

Please see the following code:

// Open source document.

Document doc = new Document("C:\\Temp\\in.docx");

// Set PdfSaveOptions

PdfSaveOptions opt = new PdfSaveOptions();

opt.SaveFormat = SaveFormat.Pdf;

opt.TextCompression = PdfTextCompression.Flate;

opt.JpegQuality = 60;

doc.Save("C:\\Temp\\out.pdf", opt);

Regarding Aspose.Cells and Aspose.Slides, could you please write to the appropriate forums and my colleagues will answer you shortly.

Best regards,

Thank you AndreyN.

I don’t see the compression level option when I create an object of class PdfSaveOptions. The ony property I see is the SaveOptions and that does not have the compression level on it. I need to have a way of compressing the PDF file I’m saving with Aspose.PDF because it’s highly uncompressed.


What we’re doing is to concatenate separate PDFs coming from a reporting tool but the final file is not very efficiently compressed. A 9 MB file created by Aspose can be compressed to 1.5 Mb by Acrobat Pro. Is there a way to improve the compression level in Aspose?

Hi David,


Thanks for your inquiry. Aspose.Words offers PdfSaveOptions class that can be used to specify additional options when saving a document into the Pdf format. Also, we have recently updated the documentation; please check for TextCompression property in class members list.

If we can help you with anything else, please feel free to ask.

Best Regards,