Table of contents

Thanks for Downloading Dynamic Web TWAIN 30-Day Trial!

Your download will start shortly. If your download does not begin, click here to retry.

Document Saving

How can I reduce the size of documents in PDF, TIFF or JPEG format?

There are a few things that you can try to reduce the size of a resulting file

  • Scan in grayscale or black & white instead of RGB;

  • Convert the images to grayscale or black & white before the save or upload call. Read more here;

  • Scan in a lower resolution;

  • Convert the images to a lower resolution (DPI). Read more here;

  • [Optional] If the resulting file is in the JPEG format (.jpg) or is a TIF or PDF that is encoded by the JPEG standard, you can set JPEGQuality to a lower value.

    • Save in PDF format (No PDF Rasterizer Addon license is required for this API),
      DWTObject.Addon.PDF.Write.Setup({compression: Dynamsoft.DWT.EnumDWT_PDFCompressionType.PDF_JPEG, quality: 20});
      //or set DWTObject.Addon.PDF.Write.Setup({compression: 5, quality: 20}); which is equivalent.
    
      <!--Note: if you are using this method, you need to include dynamsoft.webtwain.addon.pdf.js file into the program. For example:-->
      <script type="text/javascript" src="Resources/addon/dynamsoft.webtwain.addon.pdf.js"> </script>
    
    • Save in TIF format,
      DWTObject.TIFFCompressionType = Dynamsoft.DWT.EnumDWT_TIFFCompressionType.TIFF_JPEG;
      //or set DWTObject.TIFFCompressionType = 7 which is equivalent.
      DWTObject.JPEGQuality = 20;
    
    • Save in JPEG format.
      DWTObject.JPEGQuality = 20;
    

    Note that black & white image cannot be saved in the JPEG format. To reduce the size, please convert the image to grayscale.

Is this page helpful?

YesYes NoNo

In this article: