Dev Center
{WebTwainObject}.Addon.PDF
{WebTwainObject} denotes the
WebTwain
instance.
Methods
GetConvertMode() |
IsModuleInstalled() |
IsTextBasedPDF() |
SetConvertMode() |
SetPassword() |
SetResolution() |
Write.Setup() |
Syntax
/**
* Return the convert mode.
*/
GetConvertMode(): number;
Availability
Desktop Service Edition | WebAssembly Edition | ||||
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) | WASM |
not supported | v17.2+ | v17.2+ | v17.2+ | v17.2+ | v16.0+ |
Syntax
/**
* Return whether the PDF module has been installed.
*/
IsModuleInstalled(): boolean;
Availability
Desktop Service Edition | WebAssembly Edition | ||||
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) | WASM |
v14.1+ | v14.1+ | v14.1+ | v14.1+ | v14.1+ | v16.0+ |
Syntax
/**
* Detect whether a local PDF file is text based or not.
* @path Specify the path of the PDF file.
*/
IsTextBasedPDF(path: string): boolean;
Availability
Desktop Service Edition | WebAssembly Edition | ||||
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) | WASM |
v11.2+ | v11.2+ | v11.2+ | v11.2+ | v11.2+ | v16.0+ |
Syntax
/**
* Set the convert mode.
* @param mode Specify the mode. The default value is 3 (Dynamsoft.DWT.EnumDWT_ConvertMode.CM_AUTO)
*/
SetConvertMode(mode: Dynamsoft.DWT.EnumDWT_ConvertMode | number): boolean;
Usage notes
There are four conversion modes
Use this method before you import a PDF into the viewer with methods such as LoadImage()
, HTTPDownload()
and FTPDownload()
.
Availability
Desktop Service Edition | WebAssembly Edition | ||||
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) | WASM |
v11.2+ | v11.2+ | v11.2+ | v11.2+ | v11.2+ | v16.0+ |
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()
.
Availability
Desktop Service Edition | WebAssembly Edition | ||||
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) | WASM |
v11.2+ | v11.2+ | v11.2+ | v11.2+ | v11.2+ | v16.0+ |
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()
.
Availability
Desktop Service Edition | WebAssembly Edition | ||||
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) | WASM |
v11.2+ | v11.2+ | v11.2+ | v11.2+ | v11.2+ | v16.0+ |
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.DWT.EnumDWT_PDFCompressionType | number;
/**
* Specify the page type.
* Allowed values are 0: Original, 2: A4, 6: letter, 8: legal
*/
pageType: 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()
, SaveAsPDF()
, and SaveAllAsPDF()
Only the core module license is required to use this method.
Availability
Desktop Service Edition | WebAssembly Edition | ||||
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) | WASM |
not supported | v15.0+ | v15.1+ | v15.1+ | v15.1+ | v16.0+ |
latest version