Dev Center
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.

    Before setting the JPEGQuality, set the compression type to the JPEG standard as outlined below.

    Before saving the file,

    • Step 1:
      • If you want to save in PDF format (No PDF Rasterizer Addon license needed for this API),
        DWObject.Addon.PDF.Write.Setup({compression: Dynamsoft.DWT.EnumDWT_PDFCompressionType.PDF_JPEG});
        //or set DWObject.Addon.PDF.Write.Setup({compression: 5}); 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>
      
      • If you want to save in TIF format,
        DWObject.TIFFCompressionType = Dynamsoft.DWT.EnumDWT_TIFFCompressionType.TIFF_JPEG;
        //or set DWObject.TIFFCompressionType = 7 which is equivalent.
      
      • If you want to save in JPEG format, please jump to Step 2 directly.
    • Step 2:
        DWObject.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:

latest version

    • Latest Version (18.4)
    • Version 18.3
    • Version 18.1
    • Version 18.0
    • Version 17.3
    • Version 17.2.1
    • Version 17.1.1
    • Version 17.0
    • Version 16.2
    • Version 16.1.1
    Change +