FoxitPDFSDKforWeb
8.5.0
Foxit PDF SDK for Web
|
Inherits Disposable.
Public Member Functions | |
addAnnot (pageIndex, annotJson) | |
Add an annotation into a specified page. [Support in Server] More... | |
addAnnotGroup (pageIndex, annotJsons, headerIndex) | |
Add a group annotation [Support in Server] More... | |
addHeaderFooter (headerFooter) | |
Add new header-footer. More... | |
applyRedaction () | |
Apply redaction in marked areas: remove the text or graphics under marked areas permanently. [Support in Server] More... | |
createRootBookmark () | |
Create the root bookmark of the document. More... | |
drmEncrypt (drmOptions) | |
exportAnnotsToFDF (fileType=0, annots=null) | |
Export annotation data in a document to a file. [Support in Server] More... | |
exportAnnotsToJSON (annotArray) | |
Export the document's annotation data to Json. [Support in Server] More... | |
exportFormToFile (fileType=0) | |
Export document form data to file. More... | |
extractPages (pageRange) | |
Export the given page(s) from the current document. More... | |
flatten (option) | |
Flatten all annotations and interactive form fields in a PDF. More... | |
getAllBoxesByPageIndex (index) | |
Gets all boxes by specified page index. More... | |
getAnnots () | |
Get an array of all annotations of the current document. [Support in Server] More... | |
getBookmarksJson () | |
Get the document's bookmarks to JSON format. More... | |
getComparisonFilterCountSummary () | |
Get the count information for each item of the comparison result; The statistical result is the total number of document difference types, but each difference occurs in pairs, so the number of differences is 1 / 2 of the total. More... | |
getEmbeddedFileNames () | |
Get the embedded file list. More... | |
getFile ({ flags=0, fileName=this.getFileName() }={ flags:0, fileName:this.getFileName() }) | |
Export the PDF document object to the File object. More... | |
getFontsInfo () | |
Get fonts info. More... | |
getHeaderFooter () | |
Get HeaderFooter of document. More... | |
getId () | |
Gets the id of the PDF document [Support in Server] More... | |
getInfo () | |
Get the information dictionary of the pdf document. More... | |
getLayerNodesJson () | |
Get the document's layer nodes. More... | |
getMetadata () | |
Get metadata of PDF document. [Support in Server] More... | |
getOriginalStream () | |
Verify signature's status. More... | |
getPageAnnots (index) | |
Get all annotations in a specified page by page index. [Support in Server] More... | |
getPageByIndex (index) | |
Get the document page [Support in Server] More... | |
getPageCount () | |
Gets the number of document pages [Support in Server] More... | |
getPageLabels (pageIndexes) | |
Get the page labels of the pdf document. More... | |
getPasswordType () | |
Get the type of current used password. [Support in Server] More... | |
getPDFForm () | |
Get form object of PDF Document. [Support in Server] More... | |
getPermission () | |
Get user access permissions. [Support in Server] If it is the owner of the document, then 4294967292 is put back to indicate full permissions. . More... | |
getPermissions () | |
Get user access permissions. [Support in Server] If it is the owner of the document, then 4294967292 is put back to indicate full permissions. . More... | |
getRootBookmark (forceRefresh=false) | |
Get the root bookmark of the document. More... | |
getStream (writeChunk, flag=0) | |
Gets a PDF file stream that can be used to download documents [Support in Server] More... | |
getText (pages) | |
Gets the text content of the specific pages. The type of XFA Documents is not supported. More... | |
getTextSearch (pattern, flags) | |
Get text search object. [Support in Server] More... | |
getUserPermissions () | |
hasForm () | |
Call this function to determine whether the document contains pdf form. More... | |
importAnnotsFromFDF (fdf, escape=true) | |
Import data from an FDF file specified by array buffer. [Support in Server] More... | |
importAnnotsFromJSON (annotsJson) | |
Import data from Json. [Support in Server] More... | |
importFormFromFile (file, format, encoding='UTF-8') | |
Import form data from an FDF file specified by array buffer. More... | |
insertBlankPages (pageRange, width, height) | |
Insert a new blank PDF page to the specified pages, by indexes. More... | |
insertPage (pageIndex, width, height) | |
Insert a new blank PDF page to document, by index. [Support in Server] More... | |
insertPages ({destIndex, file, password="", flags=0, layerName="", startIndex, endIndex}) | |
Start to import pages from another PDF document. More... | |
isCompareDoc () | |
Used to determine whether the PDF document is a comparison result document. More... | |
isDocModified () | |
Call this function to determine whether the document is modified if modified return true, false otherwise. [Support in Server] More... | |
isLinearized () | |
Call this function to determine whether the document is represented in linearized (fast web view) format. More... | |
loadPDFForm () | |
Load form data of PDF document. [Support in Server] More... | |
loadThumbnail (options) | |
Loads a thumbnail for a particular page number. More... | |
makeRedactByPages (pages) | |
Mark pages which are to be redacted. More... | |
mergePDFDoc (options) | |
Merge pages from another PDF document. More... | |
movePagesTo (pageRange, destIndex=0) | |
Move the specified pages to a new index position. More... | |
movePageTo (pageIndex, destIndex) | |
Move a specified page to a new index position. [Support in Server] More... | |
removeAllEmbeddedFiles () | |
Remove all files embedded in the current PDF document. More... | |
removeEmbeddedFileByName (name) | |
Remove the embedded file by name. More... | |
removeHeaderFooter () | |
Remove all headers and foonters of document. More... | |
removePage (pageIndex) | |
Remove a PDF page by page index. [Support in Server] More... | |
removePages (pageRange) | |
Remove the specified pages by page indexes. More... | |
rotatePages (pageRange, rotation) | |
Set the specified pages rotation. More... | |
searchText (pages, words, options={}) | |
Search the specified text on the specified page. More... | |
setLayerNodeVisible (layerId, visible) | |
Set the visibility of a specified layer node. More... | |
setMetadataValue (key, value) | |
Set metadata value. More... | |
setPagesBox ({ indexes, width, height, offsetX, offsetY, boxes, removeWhiteMargin }={}) | |
Set pages box. More... | |
setPasswordAndPermission (userPassword, ownerPassword, permission=0xfffffffc, cipher=cipherType.AES256, isEncryptMetadata=true) | |
Set document password and permission. More... | |
sign (signInfo, DigestSignHandler) | |
Get signature file stream without signed data. More... | |
signForESignUS (signInfo, esignFieldList, hashSignFun) | |
美国区签名 More... | |
updateHeaderFooter (headerFooter) | |
Modify header or footer of documents. If there is no header or footer, this function will add one. More... | |
PDF document object
|
inline |
Add an annotation into a specified page. [Support in Server]
pageIndex | {number} Specifies target page. |
annotJson | {object} Annotation's json object. |
|
inline |
Add a group annotation [Support in Server]
pageIndex | {number} - Specifies target page. |
annotJsons | {object} - Annotation's json object. |
headerIndex | {number} - Indicates the header annotation's index. |
|
inline |
Add new header-footer.
A PDF document can be added header-footer sereral times. When a new header-footer is added, the old ones will not be removed but be covered by the new one if the old ones appear in the same place as new one.
headerfooter | {HeaderFooter} A valid header-footer object to be added to current document. |
|
inline |
Apply redaction in marked areas: remove the text or graphics under marked areas permanently. [Support in Server]
|
inline |
Create the root bookmark of the document.
|
inline |
This class represents a Foxit DRM(Digital Right Management) security handler, used for Foxit DRM encryption.
drmOptions | {object} |
[drmOptions.isEncryptMetadata=false] | {boolean} A boolean value to decide whether to encrypt metadata or not. true means to encrypt metadata, and false means not to encrypt metadata. |
drmOptions.subFilter | {string} The sub filter of PDF document. |
drmOptions.cipher | {number} Cipher type. Please refer to values starting from Cipher_Type::cipherRC4 and this should be one of these values except Cipher_Type::cipherNone. |
drmOptions.keyLength | {number} The key length, in bytes. For Cipher_Type::cipherRC4 cipher, this value should be between 5 and 16. For Cipher_Type::cipherAES cipher, this value should be 16 or 32. |
drmOptions.isOwner | {boolean} A boolean value to decide whether current user is owner or not. true means current user is owner, and false means current user is not owner. Default: false. |
drmOptions.userPermissions | {number} The user permissions. Please refer to values starting from User_Permissions::print and this can be one or combination of these values. |
drmOptions.fileId | {string} The file identity string. |
drmOptions.initialKey | {string} The user specified initial key for encryption. |
[drmOptions.values] | {object} Set the DRM value for a specified parameter. A parameter string as the key name. It should not be an empty string. Followings are pre-defined key names: Issuer: issuer name. Creator: creator of this file. FileID: file ID. FlowCode: flow code for application control. Order: order number. User: user name. ServiceURL: service URL for remote server. Vender: vender name. |
|
inline |
Export annotation data in a document to a file. [Support in Server]
fileType | {number} - Specify data file type. File_Type.xfdf or File_Type.fdf. The default is File_Type.fdf. |
[annots] | {Annot[]} - Specifies particular annots to be exported. If it's null, all annotations will be exported. [Not support in Server] |
|
inline |
Export the document's annotation data to Json. [Support in Server]
annots | {Array<Annot>} - An array with annots that will be exported. All annots will be exported with "null" parameters. |
|
inline |
Export document form data to file.
fileType | {number} - Specify data file type. Please refer to File_Type. The default is File_Type.fdf. |
|
inline |
Export the given page(s) from the current document.
pageRange | {Array} - A two-dimensional array of page indices(starts from 0) which woulb be extracted. Only positive integer in valid page range is available. For example, [[0],[2,4],[5,7]] means page 0, page 2 to page 3, and page 5 to page6 will be extracted. |
|
inline |
Flatten all annotations and interactive form fields in a PDF.
option | {number} - Specify which objects will be flattened. Please Refer to Flatten_Option |
|
inline |
Gets all boxes by specified page index.
index | number - Page index of current PDF document. |
Promise<{ mediaBox: PDFRect, // Media Box for page boundary cropBox: PDFRect, // Crop Box for page boundary trimBox: PDFRect, // Trim Box for page boundary artBox: PDFRect, // Art Box for page boundary bleedBox: PDFRect, // Bleed Box for page boundary calcBox: PDFRect, // Content area of PDF page minWidth: number, // Minimum media box width of all pages minHeight: number, // Minimum media box height of all pages width: number, // Media box height of current page height: number // Media box height of current page }>
|
inline |
Get an array of all annotations of the current document. [Support in Server]
|
inline |
Get the document's bookmarks to JSON format.
|
inline |
Get the count information for each item of the comparison result; The statistical result is the total number of document difference types, but each difference occurs in pairs, so the number of differences is 1 / 2 of the total.
|
inline |
Get the embedded file list.
|
inline |
Export the PDF document object to the File object.
[options] | object |
[options.flags] | number - Document saving flags. Please refer to Saving_Flag. Default: Saving_Flag::normal. |
[options.fileName] | string - PDF file name |
|
inline |
Get fonts info.
|
inline |
Get HeaderFooter of document.
|
inline |
Gets the id of the PDF document [Support in Server]
|
inline |
Get the information dictionary of the pdf document.
|
inline |
Get the document's layer nodes.
|
inline |
Get metadata of PDF document. [Support in Server]
|
inline |
Verify signature's status.
field | {PDFField} - The signature field to be verified. |
VerifyHandler | {(signatureField,plainBuffer,signedData,hasDataOutOfScope)=>Promise<number>} - Verify handler which is used to check signature's validity. |
|
inline |
Get all annotations in a specified page by page index. [Support in Server]
index | {number} - page index |
|
inline |
|
inline |
Gets the number of document pages [Support in Server]
|
inline |
Get the page labels of the pdf document.
pageIndexes | {[number]} - Could be undefined or page number indexes array. If it's undefined, then all the page labels are returned. |
|
inline |
Get the type of current used password. [Support in Server]
|
inline |
Get form object of PDF Document. [Support in Server]
|
inline |
Get user access permissions. [Support in Server]
If it is the owner of the document, then 4294967292 is put back to indicate full permissions.
.
|
inline |
Get user access permissions. [Support in Server]
If it is the owner of the document, then 4294967292 is put back to indicate full permissions.
.
|
inline |
Get the root bookmark of the document.
|
inline |
Gets a PDF file stream that can be used to download documents [Support in Server]
writeChunk | {Function} - Callbacks in the form of fragment flows: function ({arrayBuffer, offset, size}) {} - arrayBuffer: fragment stream, offset: fragment offset, size: fragment size |
flag | number - Document saving flags. Please refer to Saving_Flag. Default: Saving_Flag::normal. |
|
inline |
Gets the text content of the specific pages. The type of XFA Documents is not supported.
pages | {Array} - The page index where content will be extracted. |
|
inline |
Get text search object. [Support in Server]
pattern | {string} - Specifies text to search. |
flags | {number} - The following bit of flags can be used individually or in combination. 0: No special searching options. 1: If set, match the case of keyword when searching. 2: If set, match the whole word of keyword when searching. 4: If set, match the key word consecutively when searching. For example, "CC" will be matched twice in "CCC". |
|
inline |
Get user access permissions. [Support in Server]
|
inline |
Call this function to determine whether the document contains pdf form.
|
inline |
Import data from an FDF file specified by array buffer. [Support in Server]
fdf | {File|Blob|ArrayBuffer|TypeArray|ViewData} - Specify fdf file's stream. |
escape | {boolean} - Skip annotationImportedEx event |
|
inline |
Import data from Json. [Support in Server]
annotsJson | {IAnnotationSummary[]} - Specify annots' json array. |
|
inline |
Import form data from an FDF file specified by array buffer.
file | {File|Blob|ArrayBuffer|TypeArray|ViewData} - Specify fdf file's stream. |
format | {number} - File format. Please refer to File_Type. |
encoding | {string} - File encoding. Available values are same as second parameter of FileReader.readAsText . |
|
inline |
Insert a new blank PDF page to the specified pages, by indexes.
pageRange | {Array} - A two-dimensional array of page indices(starts from 0) which would be inserted. Only positive integer in valid page range is available. For example, [[0],[2,4],[5,7]] means page 0, page 2 to page 3, and page 5 to page6 will be inserted. |
width | {number} - Width of new page. |
height | {number} - Height of new page. |
|
inline |
Insert a new blank PDF page to document, by index. [Support in Server]
pageIndex | {number} - The page index for new page. |
width | {number} - Width of new page. |
height | {number} - Height of new page. |
|
inline |
Start to import pages from another PDF document.
insertOptions | {object} - Options for inserting pages. |
insertOptions.destIndex | {number} - A page index in current PDF document. Default value:0. If less than 0 or more than total page, will throw error. |
insertOptions.file | {File|Blob|ArrayBuffer|TypeArray|ViewData} - Specify PDF file's stream where pages will be exported from. |
insertOptions.password | {string} - Specify document's password. It can be left empty. |
insertOptions.flags | {number} - Options for importing pages.0:Import pages normally.1:Import pages with layers. Default value:0. |
insertOptions.layerName | {string} - The name of non-selectable label or the prefix name of the non-selectable label to be shown in layer panel of application.If parameter flags is 1, this should not be empty and should be a valid string. If parameter flags is not 1, this string will be ignored. |
insertOptions.startIndex | {number} - The start index of a range segment. Default value:0. Support negative number, but if total page is 11, the -12 will throw error. |
insertOptions.endIndex | {number} - The end index of a range segment. Default value:0. Support negative number, but if total page is 11, the -12 will throw error. |
|
inline |
Used to determine whether the PDF document is a comparison result document.
|
inline |
Call this function to determine whether the document is modified if modified return true, false otherwise. [Support in Server]
|
inline |
Call this function to determine whether the document is represented in linearized (fast web view) format.
|
inline |
Load form data of PDF document. [Support in Server]
|
inline |
Loads a thumbnail for a particular page number.
options | object - An object specifying the options for load thumbnails. The following parameters should be properties on this object. The only non-optional parameter is pageNumber |
options.pageIndex | number - The page number of requested thumbnail. |
[options.scale] | number - The scale value to render the page at. |
[options.rotation] | number - The rotation of the page. Valid values are: 0, 90, 180, 270 |
[options.type='canvas'] | 'canvas' | 'image' | 'buffer' - The type of returning result. |
[options.width] | number - Used to calculate the scale if scale value is not provided. If it's passed the scale will be set so the document fits this width. If both width and height are passed the scale value will be set so the document fits the box delimited by them. |
[options.height] | number - Used to calculate the scale if scale value is not provided. If it's passed the scale will be set so the document fits this height. If both width and height are passed the scale value will be set so the document fits the box delimited by them |
|
inline |
Mark pages which are to be redacted.
pages | {Array[number]} - page index array which pages to be redacted. |
|
inline |
Merge pages from another PDF document.
options | object - Options object for merging PDF document. |
options.doc | PDFDoc - A PDFDoc object which is the source PDF document. Pages in this document will be imported to current PDF document. Please keep this source PDF document object valid until current document will not be saved any more or is closed |
[options.insertIndex] | number - A page index in current PDF document, This is used to specify where the imported pages will be inserted: If insertIndex is less than or equals to 0, the imported pages will be inserted to the first. If insertIndex is undefined or equals to or greater than current page count, the imported pages will be inserted to the end. |
[options.pages] | number[] - A page index array to specify which pages to be inserted. If this pages array is undefined or empty, all page in the source document will be imported. |
[options.layerName | = ''] string - The name of non-selectable label or the prefix name of the non-selectable label to be shown in layer panel of application. Default value: an empty string
|
|
inline |
Move the specified pages to a new index position.
pageRange | {Array} - A two-dimensional array of page indices(starts from 0) which would be moved. Only positive integer in valid page range is available. For example, [[0],[2,4],[5,7]] means page 0, page 2 to page 4, and page 5 to page7 will be moved. |
destIndex | {number} - A page index in current PDF document. Default value:0. If less than 0 or more than total page, will throw error. |
|
inline |
Move a specified page to a new index position. [Support in Server]
pageIndex | {number} - Index of the specified page. |
destIndex | {number} - Index of the destination position. |
|
inline |
Remove all files embedded in the current PDF document.
|
inline |
Remove the embedded file by name.
{ | string } name - the embedded file name function example(pdfDoc, fileName) { pdfDoc.removeEmbeddedFileByName(fileName); } |
|
inline |
Remove all headers and foonters of document.
|
inline |
Remove a PDF page by page index. [Support in Server]
pageIndex | {number} - Index of the specified page. |
|
inline |
Remove the specified pages by page indexes.
pageRange | {Array} - A two-dimensional array of page indices(starts from 0) which would be removed. Only positive integer in valid page range is available. For example, [[0],[2,4],[5,7]] means page 0, page 2 to page 3, and page 5 to page6 will be removed. |
|
inline |
Set the specified pages rotation.
pageRange | {Array} - A two-dimensional array of page indices(starts from 0) which would be rotated. Only positive integer in valid page range is available. For example, [[0],[2,4],[5,7]] means page 0, page 2 to page 3, and page 5 to page6 will be rotated. |
rotation | {number} - Rotation to be set. Please refer to Rotation. |
|
inline |
Search the specified text on the specified page.
pages | { Array } - The page index where content will be extracted. |
words | { Array } Specifies texts to search. |
options | {object} The matching conditions. |
|
inline |
Set the visibility of a specified layer node.
layerId | {string|number} - string ID of a layer node. |
visiable | {boolean} - true means visible, and false means invisible. |
|
inline |
Set metadata value.
key | {string} - Metadata key string. It should not be an empty string. Currently it can be one of the following keys: "Title", "Author", "Subject", "Keywords", "Creator", "Producer", "Trapped", "CreationDate", "ModDate", "pdfaid". It can also be some other custom information keys if they're supported by the PDF file. |
value | {string} - An string value of metadata value. |
|
inline |
Set pages box.
options | object - Options object for set page box. |
options.indexes | - Specifies the index of the page whose box needs to be updated. |
[options.width] | number - New page width (in PDF point unit). |
[options.height] | number - New page height (in PDF point unit). |
[options.offsetX=0] | number - x-axis offset of the page content box, Effective only if the 'width' and 'height' are both greater than the page size. |
[options.offsetY=0] | number - y-axis offset of the page content box, Effective only if the 'width' and 'height' are both greater than the page size. |
[options.boxes] | object - Contains different types of page box rectangles (in PDF coordinate system). This will be ignored when 'removeWhiteMargin' is specified as true. |
[options.boxes.cropBox] | PDFRect - New Crop Box for page boundary. The region to which the contents of page are to be clipped (cropped) white displaying or printing. |
[options.boxes.artBox] | PDFRect -New Art Box for page boundary. The intended dimensions of a finished page after trimming. |
[options.boxes.trimBox] | PDFRect - New Trim Box for page boundary. The region to which the contents of page should be clipped while outputting in a production environment. |
[options.boxes.bleedBox] | PDFRect - New Bleed Box for page boundary. The extent of page's meaningful content (including potential white space) as intended by page's creator. |
[options.removeWhiteMargin=false] | boolean - Whether to remove white borders. |
|
inline |
Set document password and permission.
userPassword | {string} - user password. |
ownerPassword | {string} - owner password. |
permission | {number} - User_Permissions 32bit numbers, Print PDF document with normal mode. (Bit 3 ); Modify PDF contents. (Bit 4);Extract PDF contents. (Bit 5);Operate text annotations and fill in interactive form fields. (Bit 6);Fill PDF form. (Bit 9);Disabilities support. (Bit 10);Assemble PDF document. (Bit 11);Print PDF document with higher qualities. (Bit 12); |
cipher | {string} - Cipher type string. Available values: "none", "rc4", "aes128", "aes256" |
isEncryptMetadata | {boolean} - true means to encrypt metadata, and false means not to encrypt metadata |
|
inline |
Get signature file stream without signed data.
signInfo | {object} - Specifies signature info. |
signInfo.filter | {object} - Specifies signature info. |
signInfo.subfilter | {object} - Specifies signature info. |
[signInfo.rect] | {PDFRect} - (Required if fieldName is absent)Position of signature. |
[signInfo.pageIndex] | {number} - (Required if fieldName is absent) Specify a page index on which this signature will appear. |
[signInfo.flag=0x100] | {number} - The appearance flag for signing. Please refer to Signature_Ap_Flags. |
[signInfo.signer] | {string} - The signer of the signature. |
[signInfo.reason] | {string} - The reason for signing. |
[signInfo.email] | {string} - The email of the signing. |
[signInfo.image] | {string} - (e.g. BLOB URL, HTTP, HTTPS, and Base64URL)The image for singing. |
[signInfo.distinguishName] | {string} - The distinguished name of signing. |
[signInfo.location] | {string} - The location of signing. |
[signInfo.text] | {string} - The signing descriptive information. |
[signInfo.defaultContentsLength] | {number} - 7942 is the default length of signature contents, in bytes. It should not be less than 4098. |
[signInfo.fieldName] | {string} - (Required if rect and pageIndex are absent) Specifies which field to be signed. |
[signInfo.timeFormat] | {object} - Customize the date format. |
[signInfo.timeFormat.format] | {string} - The default is 'YYYY.MM.DD HH:mm:ss Z'. |
[signInfo.timeFormat.timeZoneOptions] | {object} - Used if the date format parameter contains 'Z'. |
[signInfo.timeFormat.timeZoneOptions.separator] | {string} - The default is '\''. |
[signInfo.timeFormat.timeZoneOptions.prefix] | {string} - The default is ''. |
[signInfo.timeFormat.timeZoneOptions.showSpace] | {boolean} - The default is 'true'. |
DigestSignHandler | {(signInfo,plainBuffer)=>Promise<ArrayBuffer>} - The digest and sign handler. |
|
inline |
美国区签名
signInfo | 签署信息 { email, phone, reason, distinguishName, location, text, filter, subfilter } |
esignFieldList | 签名域列表 [{buffer:'image buffer', rect: []}] |
hashSignFun | 后端签名方法(promise),需要返回签名后的hash |
|
inline |
Modify header or footer of documents. If there is no header or footer, this function will add one.
headerFooter | {HeaderFooter} - HeaderFooter object. |