Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
Dev Center
Table of contents

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
    • Version 17.2.1
    • Version 17.1.1
    • Version 17.0
    • Version 16.2
    • Version 16.1.1
    Change +
    © 2003–2022 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support