|
FoxitPDFSDKforWeb
7.1.1
Foxit PDF SDK for Web
|
Public Member Functions | |
| addAnnot (annotJson) | |
| Add an annotation into the current page. This method may add an annotation along with an associated annotation like popup. More... | |
| addAnnotGroup (annotJsons, headerIndex) | |
| Add a group annotation into the current page. This method may add an annotation along with an associated annotation like popup. More... | |
| addImage (imageBuffer, rect) | |
| Add the image to page. More... | |
| addWatermark (data) | |
| Add a page watermark. More... | |
| flatten (option) | |
| Flatten all annotations and interactive form fields in a Page. More... | |
| getAnnotCount () | |
| Gets the total amount of all annotations in a specified page. More... | |
| getAnnotIdAtDevicePoint (point, tolerance, matrix) | |
| Get the specified position of an annotation in device page coordinate. More... | |
| getAnnots () | |
| Get an array of all annotations in a page. More... | |
| getAnnotsByIdArray (ids) | |
| Get an array of page annotation ID which can be obtained by Annot::getUniqueID(). More... | |
| getAnnotTree () | |
| Get a structrual tree of all annotations in a specified page. More... | |
| getCharInfoAtPoint (point, tolerance=0) | |
| Get character information at a specified position, in PDF coordination system. More... | |
| getDeviceMatrix () | |
| Get the device matrix for the page. More... | |
| getDevicePoint (point, scale=1) | |
| Convert PDF coordinates to device coordinates for the page. More... | |
| getDeviceRect (pdfRect, scale=1, rotate=0) | |
| Convert PDFRect to deviceRect. More... | |
| getHeight () | |
| Get page height. More... | |
| getIndex () | |
| Get page's index. More... | |
| getMarkupAnnots () | |
| Get only markup annotations in the current page. More... | |
| getPDFDoc () | |
| Get the document object. More... | |
| getPDFMatrix () | |
| Get page matrix. More... | |
| getRotation () | |
| Get page rotation angle. More... | |
| getRotationAngle () | |
| Get page rotation angle. More... | |
| getTextRectsAtRect (rect) | |
| Get page text rectangles in specified rectangle. More... | |
| getTextSearch (pattern, flags) | |
| Get PageTextSearch with specified pattern and flags. More... | |
| getThumb () | |
| Get the PDF stream of "Thumb". More... | |
| getWidth () | |
| Get page width. More... | |
| markRedactAnnot (rects, annot) | |
| Mark page contents (text object, image object, and path object) which are to be redacted. More... | |
| removeAllAnnot () | |
| Remove all annotations from the current page. More... | |
| removeAnnotById (id) | |
| Remove an annotation by ID from the current page. The ID can be obtained by Annot::getUniqueID(). More... | |
| reverseDeviceOffset (offset, scale=1) | |
| Convert PDF device page offset to PDF page offset. More... | |
| reverseDevicePoint (pointer, scale=1) | |
| Transform PDF page point device coordinate to PDF page coordinate. More... | |
| reverseDeviceRect (pdfRect, scale=1) | |
| Transform PDF page device rectangle to PDF page rectangle. More... | |
| setRotation (rotation) | |
PDF page object
|
inline |
Add an annotation into the current page. This method may add an annotation along with an associated annotation like popup.
| annotJson | {object} - JSON object which indecate annotation's properties. |
| annotJson.type | {String} The type of annotation to be added.{all}//type:1.highlight 2.strikeout 3.underline 4.squiggly 5.caret 6.text 7.fileattachment 8.freetext 9.ink 10.line 11.link 12.circle 13.square 14.polygon 15.polyline 16.sound 17.stamp 18.redact 19.psink 20.movie 21.widget 22.screen 23.printermark 24.trapnet 25.watermark |
| annotJson.rect | {Object} Rectangle of the new annotation.{all} |
| annotJson.rect.left | {Number} The x-coordinate of the input left-bottom corner. |
| annotJson.rect.bottom | {Number} The y-coordinate of the input left-bottom corner. |
| annotJson.rect.right | {Number} The x-coordinate of the input right-top corner. |
| annotJson.rect.top | {Number} The y-coordinate of the input right-top corner. |
| [annotJson.buffer] | {Uint8Array} The buffer of file.{fileattachment,screen} |
| [annotJson.calloutLinePoints] | {Array} Only when the intent name of a free text annotation is "FreeTextCallout", this free text annotation can have callout line points property, and this property has effect on this kind of free text annotation's appearance.{freetext}[optional] |
| [annotJson.color] | {String} New border color to be set.Format: 0xRRGGBB.{all}[optional] |
| [annotJson.contents] | {String} New content string to be set.{all}[optional] |
| [annotJson.coords] | {Array} For a text markup annotation, quadrilaterals are required. This property has effect on text markup annotation's appearance. After setting new quadrilaterals, rectangle of current text markup annotation will be updated as well.{textmarkup}(required) |
| [annotJson.creationTimestamp] | {Timestamp} Set creation date time.{markup}[optional] |
| [annotJson.date] | {Timestamp} Set last modified date time.{all}[optional] |
| [annotJson.dicts] | {Object} Set annotation's dictionary object.{all}[optional] |
| [annotJson.endCharIndex] | {Number} For a text markup annotation, index of the end character.{textmarkup}[optional] |
| [annotJson.endPoint] | {Object} Set the end point of line.{x: number, y: number}{line}[optional] |
| [annotJson.endPoint.x] | {Number} The value of the X-axis in the end point.{line}[optional] |
| [annotJson.endPoint.y] | {Number} The value of the Y-axis in the end point.{line}[optional] |
| [annotJson.endStyle] | {Number} Set line ending style of the end point.0:"None",1:"Square",2:"Circle",3:"Diamond",4:"OpenArrow",5:"ClosedArrow",6:"Butt",7:"ROpenArrow",8:"RClosedArrow",9:"Slash".{line}[optional] |
| [annotJson.fileName] | {String} The file name to be set. It should not be an empty string.{fileattachment,screen} |
| [annotJson.icon] | {String} Set icon name.{stamp}[optional] |
| [annotJson.iconCatagory] | {String} Set stamp icon's catagory.{stamp}[optional] |
| [annotJson.inkList] | {Array} Set ink list data.If type is "ink", it should not be an empty.{ink} |
| [annotJson.intent] | {String} Set intent name.{markup}[optional] |
| [annotJson.multiBuffer] | {Uint8Array} The buffer of Media.{screen} |
| [annotJson.name] | {String} New unique ID string to be set.{all}[optional] |
| [annotJson.noPopup] | {Boolean} If true, no popup is generated,else popup is generated.{markup}[optional] |
| [annotJson.opacity] | {Number} Set opacity value.{markup}[optional] |
| [annotJson.startCharIndex] | {Number} For a text markup annotation,Index of the start character.{textmarkup}[optional] |
| [annotJson.startStyle] | {Number} Set line ending style of the start point.0:"None",1:"Square",2:"Circle",3:"Diamond",4:"OpenArrow",5:"ClosedArrow",6:"Butt",7:"ROpenArrow",8:"RClosedArrow",9:"Slash".{line}[optional] |
| [annotJson.startPoint] | {Object} Set the start point of line.{x: number, y: number}{line}[optional] |
| [annotJson.startPoint.x] | {Number} The value of the X-axis in the start point.{line}[optional] |
| [annotJson.startPoint.y] | {Number} The value of the Y-axis in the start point.{line}[optional] |
| [annotJson.style] | {number} New border style to be set.{all}[optional] //solid: 0, dashed: 1, underline: 2, beveled: 3, inset: 4, cloudy: 5 |
| [annotJson.subject] | {String} Set subject string.If the value is "replace," that means that this is a Replace annotation.{markup}[optional] |
| [annotJson.title] | {String} Set title string.{markup}[optional] |
| [annotJson.vertexes] | {Array} Set vertexes.{polyline,polygon}[optional] |
|
inline |
Add a group annotation into the current page. This method may add an annotation along with an associated annotation like popup.
| annotJsons | - An array of annotations json. |
| headerIndex | - Index of header annotation. |
|
inline |
Add the image to page.
| imageBuffer | {Uint8Buffer} - Image ArrayBuffer. |
| rect | {PDFRect} - Image Rect. {left:number,right:number, top: number, bottom: number} |
|
inline |
Add a page watermark.
| watermarkConfig | {Object} - Page watermarking configuration. Example: { type:"text", text:"This is a watermark", watermarkSettings:{ position:"TopLeft", offsetX:0, offsetY:0, scaleX:1, scaleY:1, rotation:45, opacity:100 }, watermarkTextProperties:{ font:2, fontSize:20, color:0x000000, fontStyle:"normal", lineSpace:10, alignment:"center" } }; |
| watermarkConfig.type | - {String} - 1."text" represents a text type watermark. 2."bitmap" represents the image type watermark. |
| watermarkConfig.text | {String} - Text type watermark string.If type is "text". |
| watermarkConfig.bitmap | {Uint8Array} - Image type watermark buffer.If type is "bitmap". |
| watermarkConfig.watermarkSettings | {Object} - watermark -related configuration. |
| watermarkConfig.watermarkSettings.position | {String} - The default value is "Center". 1."TopLeft":Position: top left. 2."TopCenter":Position: top center. 3."TopRight":Position: top right. 4."CenterLeft":Position center left. 5."Center":Position: center. 6."CenterRight":Position: center right. 7."BottomLeft":Position: bottom left. 8."BottomCenter":Position: bottom center. 9."BottomRight":Position: bottom right. |
| watermarkConfig.watermarkSettings.offsetX | {Number} - Horizontal offset.The default value is 0. |
| watermarkConfig.watermarkSettings.offsetY | {Number} - Vertical offset.The default value is 0. |
| watermarkConfig.watermarkSettings.flags | {Number} - Combination of following value. The default value is 2. 1."0":If set, the watermark will be a part of page content when inserted to a PDF page. 2."1":If set, the watermark will be an annotation when inserted to a PDF page. 3."2":If set, show watermark above other page content. 4."4":If set, do not print a watermark. 5."8":If set, do not display a watermark. |
| watermarkConfig.watermarkSettings.scaleX | {Number} - Horizontal scale coefficient.The default value is 1. |
| watermarkConfig.watermarkSettings.scaleY | {Number} - Vertical scale coefficient.The default value is 1. |
| watermarkConfig.watermarkSettings.rotation | {Number} - Rotation angle in degrees.The default value is 45. |
| watermarkConfig.watermarkSettings.opacity | {Number} - Opacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.The default value is 100. |
| watermarkConfig.watermarkTextProperties | {Object} - Configuration for text watermarking. |
| watermarkConfig.watermarkTextProperties.font | {Number} - A valid Font object used for the text.The default value is "0". 1."0":Standard font: Courier. 2."1":Standard font: Courier-Bold. 3."2":Standard font: Courier-BoldOblique, Bold italic. 4."3":Standard font: Courier-Oblique, Italic. 5."4":Standard font: Helvetica. 6."5":Standard font: Helvetica-Bold. 7."6":Standard font: Helvetica-BoldOblique, Bold italic. 8."7":Standard font: Helvetica-Oblique, Italic. 9."8":Standard font: Times-Roman. 10."9":Standard font: Times-Bold. 11."10":Standard font: Times-BoldItalic. 12."11":Standard font: Times-Italic. 13."12":Standard font: Symbol. 14."13":Standard font: ZapfDingbats. |
| watermarkConfig.watermarkTextProperties.fontSize | {Number} - font size.The default value is 20. |
| watermarkConfig.watermarkTextProperties.color | {Number} - <Hexadecimal> font color.The default value is "0x000000". |
| watermarkConfig.watermarkTextProperties.fontStyle | {String} - The default value is "normal". 1."normal":Watermark font style: normal. 2."underline":Watermark font style: with underline. |
| watermarkConfig.watermarkTextProperties.lineSpace | {Number}- line spacing.The default value is 10. |
| watermarkConfig.watermarkTextProperties.alignment | {String}-The default value is "center". 1."left":Left alignment. 2."center":Center alignment. 3."right":Right alignment. |
|
inline |
Flatten all annotations and interactive form fields in a Page.
| option | {int} - Flatten type: e_FlattenAll = 0, e_FlattenNoAnnot = 0x0001, e_FlattenNoFormControl = 0x0002. 0x0000 means flatten all annotations and interactive form. 0x0001 means flatten all interactive form. 0x0002 means flatten all annotations. |
|
inline |
Gets the total amount of all annotations in a specified page.
|
inline |
Get the specified position of an annotation in device page coordinate.
| [x,y] | {[number, number]} - The specified position, in device coordinate system. |
| tolerance | {number} - The tolerance value. Valid range: 0.0f to 30.0f. |
| matrix | {Matrix} - The device matrix such as page.getDeviceMatrix(); |
|
inline |
Get an array of all annotations in a page.
|
inline |
Get an array of page annotation ID which can be obtained by Annot::getUniqueID().
| ids | {Array[string]} - Specifies annotations ID. |
|
inline |
Get a structrual tree of all annotations in a specified page.
|
inline |
Get character information at a specified position, in PDF coordination system.
| [x,y] | {[number, number]} - The specified position, in PDF coordinate system. |
| tolerance | {number} - Tolerance value. Valid range: 0.0f to 30.0f. |
|
inline |
Get the device matrix for the page.
|
inline |
Convert PDF coordinates to device coordinates for the page.
| [x,y] | {[number,number]} - Specifies PDF page point coordinate. |
| [scale=1] | {number} - Indecate magnification |
|
inline |
Convert PDFRect to deviceRect.
| pdfRect | {PDFRect} - PDF Rect. {left:number,right:number, top: number, bottom: number} |
| [scale=1] | {number} - Rect magnification |
| [rotate=0] | {number} - Rotation Angle. Only support multiples of 90. The other values default to 0. |
|
inline |
Get page height.
|
inline |
Get page's index.
|
inline |
Get only markup annotations in the current page.
|
inline |
Get the document object.
|
inline |
Get page matrix.
|
inline |
Get page rotation angle.
|
inline |
Get page rotation angle.
|
inline |
|
inline |
Get PageTextSearch with specified pattern and flags.
| pattern | {String} |
| flags | {number} - Refer to the following values, which can be one or a combination of these values. 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 the PDF stream of "Thumb".
|
inline |
Get page width.
|
inline |
Mark page contents (text object, image object, and path object) which are to be redacted.
| rects | - Specify areas in the page to be marked. It should not be an empty array. All the input rectangles will be treated as one redact annotation. |
|
inline |
Remove all annotations from the current page.
|
inline |
Remove an annotation by ID from the current page. The ID can be obtained by Annot::getUniqueID().
| id | {string} - An ID string of the annotation which will be removed. |
|
inline |
Convert PDF device page offset to PDF page offset.
| [dx,dy] | {[number, number]} - Device offset. |
| [scale=1] | {number} - Indecates magnification. |
|
inline |
Transform PDF page point device coordinate to PDF page coordinate.
| [x,y] | {[number, number]} - Specifies device point coordinate |
| [scale=1] | {number} - Indecates magnification. |
|
inline |
Transform PDF page device rectangle to PDF page rectangle.
| pdfRect | {DeviceRect} - Indecates PDF page device rectangle |
| [scale=1] | {number} - Indecates magnification. |
|
inline |
Set page rotation.
| rotation | {number} - 0: 0deg, 1: 90deg, 2: 180deg, 3 270deg; |