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

{WebTwainObject}.Addon.PDF

{WebTwainObject} denotes the WebTwain instance.

Methods


GetConvertMode

Syntax

/**
 * Return the convert mode.
 */
GetConvertMode(): number;

IsModuleInstalled

Syntax

/**

* Return whether the PDF module has been installed.

*/
IsModuleInstalled(): boolean;

IsTextBasedPDF

Syntax

/**
 * Detect whether a local PDF file is text based or not.
 * @path Specify the path of the PDF file.
 */
IsTextBasedPDF(path: string): boolean;

SetConvertMode

Syntax

/**
 * Set the convert mode.
 * @param mode Specify the mode. The default value is 3 (Dynamsoft.EnumDWT_ConvertMode.CM_AUTO)
 */
SetConvertMode(mode: Dynamsoft.EnumDWT_ConvertMode | number): boolean;

Usage notes

There are three conversion modes

  • CM_RENDERALL (1): All the content in the target PDF file will be rasterized.
  • CM_IMAGEONLY (2): The PDF Rasterizer is turned off.
  • CM_AUTO (3): The library automatically detect whether a file needs to be rasterized or not and then process the file accordingly.

Use this method before you import a PDF into the viewer with methods such as LoadImage() , HTTPDownload() and FTPDownload().


SetPassword

Syntax

/**
 * Set the password for reading encrypted PDF files.
 * @param password Specify the password.
 */
SetPassword(password: string): boolean;

Usage notes

Use this method before you import a PDF into the viewer with methods such as LoadImage() , HTTPDownload() and FTPDownload().


SetResolution

Syntax

/**
 * Set the resolution for rasterizing.
 * @param resolution Specify the resolution.
 */
SetResolution(resolution: number): boolean;

Usage notes

The default resolution for the conversion is 200. We recommend that you set a value smaller than 300, otherwise it might slow down the program or cause the process to fail.

Use this method before you import a PDF into the viewer with methods such as LoadImage() , HTTPDownload() and FTPDownload().


Write. Setup()

Syntax

/**
 * Set up the PDF writing engine.
 * @param settings Configures how the PDF is generated.
 */
Write.Setup(settings: PDFWSettings): void;

interface PDFWSettings {
    /**
     * Specify the author.
     */
    author: string;
    /**
     * Specify the compression type.
     */
    compression: Dynamsoft.EnumDWT_PDFCompressionType | number;
    /**
     * Specify the creator.
     */
    creator: string;
    /**
     * Specify the creation date.
     * Note that the argument should start with 'D:' like 'D:20181231'.
     */
    creationDate: string;
    /**
     * Specify the key words.
     */
    keyWords: string;
    /**
     * Specify the modified date.
     * Note that the argument should start with 'D:' like 'D:20181231'.
     */
    modifiedDate: string;
    /**
     * Specify the producer.
     */
    producer: string;
    /**
     * Specify the subject.
     */
    subject: string;
    /**
     * Specify the title.
     */
    title: string;
    /**
     * Specify the PDF version. For example, 1.5. The allowed values are 1.1 ~ 1.7.
     * NOTE: If the compression type is PDF_JBig2, the lowerest version is 1.4
     * If the compression type is PDF_JP2000, the lowerest version is 1.5
     */
    version: number;
    /**
     * Specify the quality of the images in the file.
     * The value ranges from 0 to 100.
     * Only valid when the {compression} is 'JPEG' or 'JPEG2000'.
     */
    quality: number;
}

Usage notes

Use this method before you create a PDF with methods such as HTTPUpload() and SaveAsPDF()

Only the core module license is required to use this method.

Is this page helpful?

YesYes NoNo

In this article:

version 16.2

  • 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