We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Lowering PDF size or PDF quality on converstion

Hello I am wondering if there is a way to lower the PDF size or quality for all docs converted to PDF.  I am converting a great amount of documents that I am printing and I am trying to optimize the time it takes to print out maybe hundreds of pdf files which I have converted using your tool.

Thank you

Derrick

1 Reply

CM Chinnu Muniyappan Syncfusion Team April 13, 2016 11:32 AM UTC

Hi Derrick,

Thank you for contacting Syncfusion support.

Please find the below steps to reduce the PDF file size.
Doc to PDF converter supports to reduce the image quality of the converted PDF file, so you can reduce the converted PDF file size, Please refer the below code snippet for more details.

     //word document

  WordDocument wordDocument = new WordDocument("../../DoctoPDF.doc");


  //Create new instance for the doc to pdf converter

  DocToPDFConverter converter = new DocToPDFConverter();


  //Set the image quality

  converter.Settings.ImageQuality = 10;



You can set the PDF document compression level to it is best to reduce the file size. Please refer the below code snippet.

         //Convert the word document to PDF

            PdfDocument doc = converter.ConvertToPDF(wordDocument);


         //Set the PDF compression

         doc.Compression = PdfCompressionLevel.Best;


         //Save the document

         doc.Save("output.pdf");




And also we have created a simple sample for your reference, please refer the below sample for more details.
http://www.syncfusion.com/downloads/support/forum/123702/ze/WPFSample-2053799360.zip

Please let us know if you have any concern.

Regards,
Chinnu

Loader.
Up arrow icon