Information for setting headers and footers
Add standard font to document.
The name of the font.
Optionalencoding: FontEncodingTypeThe font encoding.
Returns a new PDFFont instance.
Add watermark without updating document view.
Information for setting the WatermarkElementInfoType
1 for success, 0 for failure
Invalidates all modification.
Closes the doc object.
Optionaloptions: CloseOptionsClose parameters, default values: {'promptToSave': true, 'showCancel': true}
Creates a button form field.
Creates a checkbox form field.
Creates a combobox form field.
const doc = await app.getActiveDoc();
const pageIndex = await doc.getCurrentPageIndex();
const rect = {
left: 200,
top: 550,
right: 300,
bottom: 500
};
const comboboxForm = await doc.createComboxForm({
pageIndex,
rect,
rotate: 0,
name: 'MyComboBox'
});
console.log(comboboxForm); // Combobox form field
Creates a listbox form field.
const doc = await app.getActiveDoc();
const pageIndex = await doc.getCurrentPageIndex();
const rect = {
left: 200,
top: 550,
right: 300,
bottom: 500
};
const listboxForm = await doc.createListboxForm({
pageIndex,
rect,
rotate: 0,
name: 'MyListBox'
});
console.log(listboxForm); // Listbox form field
Create a new page.
The index position of the new page.
Creates a radio button form field.
const doc = await app.getActiveDoc();
const pageIndex = await doc.getCurrentPageIndex();
const rect = {
left: 200,
top: 550,
right: 300,
bottom: 500
};
const radioButtonForm = await doc.createRadioButtonForm({
pageIndex,
rect,
rotate: 0,
name: 'MyRadioButton'
});
console.log(radioButtonForm); // Radio button form field
Creates a signature form field.
const doc = await app.getActiveDoc();
const pageIndex = await doc.getCurrentPageIndex();
const rect = {
left: 200,
top: 550,
right: 300,
bottom: 500
};
const signatureForm = await doc.createSignatureForm({
pageIndex,
rect,
rotate: 0,
name: 'MySignature'
});
console.log(signatureForm); // Signature form field
Creates a text field form.
const doc = await app.getActiveDoc();
const pageIndex = await doc.getCurrentPageIndex();
const rect = {
left: 200,
top: 550,
right: 300,
bottom: 500
};
const textFieldForm = await doc.createTextFieldForm({
pageIndex,
rect,
rotate: 0,
name: 'MyTextField'
});
console.log(textFieldForm); // Text field form
print the current document.
Performs the print operation, not including user dialog box.
Saves the document.
The save options object.
Save document options.
OptionaldocPDFOptimizer?: booleanIndicates whether to enable the document PDF optimizer.
OptionalpromptInfo?: booleanIndicates whether to prompt information.
OptionalsaveAsTempFile?: booleanIndicates whether to save the document as a temporary file.
OptionalshowProgressBar?: booleanIndicates whether to display the progress bar.
Saves the document as another file by prompting a file dialog box to specify the saving path before saving.
Extracts pages from the current document.
An array of page numbers to extract.
The path to save the extracted pages.
A Promise that resolves to true if the extraction operation is successful, otherwise false.
Gets the current DocView for specified document.
Get the current page index
Gets the specified DocView for specified document.
The index of the DocView to get.
Gets the number of DocView for specified document.
Gets the filename.
Gets the interactive form of the document.
Gets the specified Page from specified document.
Get the number of pages in the document.
Gets permissions of a document.
The document permissions. Result like
Gets the root object of the document.
Get root bookmark.
Gets the text select tool for the document.
Insert pages from one document into another at a specified position.
A promise that resolves to true if the insertion was successful, otherwise false.
Checks whether the document is modified.
Print document from specific page range.
Starting page index (0-based)
Ending page index (0-based)
Open the print dialog for the current document.
Reloads the specified page, used to refresh page view.
The specified page index.
Remove header and footer without updating document view.
Specified watermark DictValue
Remove watermark without updating document view.
Specified watermark Dictionary Value
Asynchronously replaces pages in the current PDF document.
A Promise that resolves to true if the replacement operation is successful, otherwise false.
Resize page.
Options for resizing the page
Indicates whether the resize operation was successful
Save the data of a PDF document
Output file name (e.g., D:\123.pdf)
Optionalflag: numberSave flag, default is FPD_SAVE_DEFAULT (0)
Optionalenable: booleanWhether to enable data compression, default is false
Sets the modify flag. Reader has a built-in flag that indicate whether a document has been modified, if the value of the flag is valid, the Save button on File toolbar is enable, otherwise the Save button is disable.
Set document permissions.
Add header and footer without updating document view.