Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 2.33 KB

File metadata and controls

55 lines (39 loc) · 2.33 KB
layout default-layout
noTitleIndex true
needAutoGenerateSidebar true
title How can I reduce the size of documents in PDF, TIFF or JPEG format?
keywords Dynamic Web TWAIN, Document Saving, smallest size document
breadcrumbText How can I reduce the size of documents in PDF, TIFF or JPEG format?
description How can I reduce the size of documents in PDF, TIFF or JPEG format?
date 2021-11-29 18:33:59 +0800
last_modified 2025-01-15 14:58:40 +0800

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{:target="_blank"};

  • Scan in a lower resolution;

  • Convert the images to a lower resolution (DPI). Read more here{:target="_blank"};

  • [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{:target="_blank"} 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.