FoxitPDFSDKforWeb
v10.0.0
Foxit PDF SDK for Web
|
Public Member Functions | |
addCssFonts (fonts=[]) | |
Add the custom css fonts. More... | |
addUIEventListener (type, listener) | |
Attach an event listener to PDFUI instance by type. More... | |
addViewerEventListener (type, listener) | |
Attach an event listener to PDFViewer instance by type. More... | |
callAddonAPI (addonLibrary, action, args=[]) | |
Trigger an action to specified Addon. More... | |
changeLanguage (language) | |
Switch UI language. More... | |
constructor (PDFUIOptions) | |
Constructs a PDFUI instance. More... | |
destroy () | |
Destroys a PDFUI instance. The opening document will be closed and all component DOM elements will be destroyed. More... | |
getAddonInstance (addonLibrary) | |
Retrieves a loaded UIExtension (UIX) addon instance by its associated library name. More... | |
getAllComponentsByName (name) | |
Get all components which name is the specific string. More... | |
getAnnotationIcons (annotType, onlyCustomized) | |
Get Customized icons. More... | |
getBookmarkUIService () | |
Obtains the BookmarkUIService instance. More... | |
getComponentByName (name) | |
Get the first component which name is the specific string. More... | |
getCurrentLanguage () | |
Get current language. Usually the language specified in the browser settings, if not supported it defaults to 'en-US'. More... | |
getPDFViewer () | |
Get the PDFViewer instance asynchrounously. More... | |
getRootComponent () | |
Obtains the root component instance. More... | |
getSelectedTextInfo () | |
Gets the currently selected text information, including the text boundary rectangle in point unit based on the PDF page coordinates, the PDFPage instances and text content. If there's no text is selected, this method returns a none value promise instance. The PDF point unit of the rectangle can be converted to device pixels, as shown in the following example: pdfui.getSelectedTextInfo() .then(info => { if(!info) { return; } return pdfui.getPDFViewer().then(viewer => { const pdfPage = info.page; const pageIndex = pdfPage.getIndex(); const pageRender = viewer.getPDFPageRender(pageIndex); const pageScale = pageRender.scale; return info.rectArray.map(rect => pdfPage.getDeviceRect(rect, scale)) }); }) .then(rectArrayInPixelUnit => { // to do sth. }); . More... | |
getStampService () | |
Obtains the StampService instance. More... | |
loading (coverOn=document.body, text='', animation=true) | |
Overlays a loading modal layer on a specified element. More... | |
openFormPropertyBoxAfterCreated (isOpen) | |
Set whether the properties box is displayed when creating a form field. More... | |
registerSignatureFlowHandler (signatureHandler) | |
Register the signature flow handler. More... | |
registerSignaturePropertyHandler (handler) | |
Register the signed properties dialog handler . More... | |
registerSignHandler (handler) | |
Register signing handler. More... | |
removeUIEventListener (type, listener) | |
Detach event listener from PDFUI instance by type and its callback function. More... | |
removeViewerEventListener (type, listener) | |
Detach event listener from PDFViewer instance by type and its callback function. More... | |
setDefaultMeasurementRatio ({ userSpaceScaleValue=1, userSpaceUnit='inch', realScaleValue=1, realUnit='inch' }={}) | |
Set the default scale ratio for measuring. More... | |
setSnapshotInteractionClass (interactionClass) | |
Override the builtin interaction class, and customize the behavior of the snapshot tool buttons. More... | |
setVerifyHandler (handler) | |
Register signature verifying handler. More... | |
waitForInitialization () | |
A method returns a Promise instance that will be fullfilled after PDFUI completes initialization. More... | |
Public Member Functions inherited from PDFViewer | |
activateAnnotation (options) | |
Jumps to and activates a specified annotation with an option determining if to expand the comment list. More... | |
activateElement (element) | |
Activates an activatable object;. More... | |
addAnnotationIcon (icon) | |
Add an annotation icon. [Not support in Server] More... | |
addFontMaps (fontMaps) | |
Sets a custom font in the viewer for editing PDF text/form field. Before using this function, you should call setJRFontMap() to map the available fonts. More... | |
async | close (before=this.customs.closeDocBefore, after=this.customs.closeDocAfter, options={}) |
Close the open document. More... | |
async | compareDocuments (baseDocId, otherDocId, params, onprogress) |
Compare this PDFDoc with the otherDoc , and then generate a PDFDoc as comparison result. More... | |
constructor ({ preloadJR=true, preloadSR=false, libPath, jr, sr, i18n, i18nOptions, eventEmitter=new EventEmitter(), minScale=0.01, maxScale=10, defaultScale='fitWidth', scaleFrequency=0, tileSize=1000000, tileCache=2, getTileSize=null, StateHandlers=[], customs={}, keymap={}, Viewmodes=[], enableJS, enableSafeMode, stateHandlerConfig, watermarkConfig, actionOptions={}, defaultViewMode=continuousViewModeName, snapshotServer=new SnapshotServer({ uploadSnapshotAPIPath:'snapshot/upload' }), collaboration={ enable:false, annotationFormat:'fdf', communicator:null, handlerClasses:[], continueToConnect:(retryTimes, shareId)=> {return retryTimes< 15;} }, highPerformance=false, annotRenderingMode, defaultKeyboardEventBinder=VIEWER_BINDER, defaultAnnotConfig, enableSignature, enableShortcutKey=true, enable3DInteraction=true, enableLoad3DModule=true, engineMode=JR, sharedWorker=false, noJSFrame=false, showCommentList=false, showAnnotTooltip=false, showFormFieldTooltip=false, showMeasurementInfoPanel=true, viewerUI, applicationContext, instanceId, messageSyncServiceWorker, }={}) | |
Create a PDFViewer. More... | |
convertClientCoordToPDFCoord ({clientX=0, clientY=0}) | |
An API to get coordinate information for the PDF coordinate system from device coordinates. More... | |
convertImageToPDFDoc (file, url, title="untitled.pdf", author="", options={}, pdfEngine=this.pdfEngine) | |
Convert image to PDF document from file or url, supported image types are bmp/jpeg/png/gif. [Not support in Server] More... | |
copyAnnots (annots) | |
Copy Annotations. No copy in the clipboard. More... | |
copySnapshot (dataURL) | |
Copy image data to clipboard via dataURL. More... | |
createNewDoc (title="untitled.pdf", author="", pageSize={height:842, width:595}, options={isRenderOnDocLoaded:true}, pdfEngine=this.pdfEngine) | |
Create a new pdf document. [Not support in Server] More... | |
deactivateElement (element) | |
Deactives an activatable object;. More... | |
getActionCallbackManager () | |
Obtains the ActionCallbackManager. More... | |
getAllActivatedElements () | |
Obtains all activable elements. More... | |
getAnnotAuthorityManager () | |
Obtains the AnnotationAuthorityManager. More... | |
getAnnotManager () | |
Get annotation component manager. More... | |
getAnnotRender (pageIndex, name) | |
Get annot render. PDFPageRender::getAnnotRender. More... | |
getBookmarkDataService () | |
Obtains the BookmarkDataService instance for managing bookmark data. More... | |
getCurrentPDFDoc () | |
Get current pdf doc object. More... | |
getCustomOptionsUpdater () | |
Retrieves the CustomOptionsUpdater instance for updating custom options dynamically. More... | |
getDefaultAnnotConfig () | |
Get the callback function which is used to configure the default settings for the annotations. More... | |
getEnableJS () | |
Checks if PDF js can be executed. [Not support in Server] More... | |
getEventEmitter () | |
Get event emitter. More... | |
getFormHighlightColor () | |
getInkSignList (type) | |
Get ink signature list. More... | |
getInstanceId () | |
Get the unique instance ID. More... | |
getOverlayComparisonOptionsService () | |
Obtains the OverlayComparisonOptionsService, which will be used to configure and share overlay-comparison options between multiple PDFViewer instances and to monitor option changes. More... | |
getOverlayComparisonService () | |
Obtains the OverlayComparisonService instance, which includes the built-in overlay comparison function. More... | |
getPDFDocFromImageFile (file, url, title="untitled.pdf", author="") | |
getPDFDocRender () | |
GetPDFDocRender. More... | |
getPDFPageRender (index) | |
GetPDFPageRender PDFDocRender::getPDFPageRender. More... | |
getReadAloudService () | |
Obtains the ReadAloudService instance. More... | |
getRotation () | |
Obtains the rotation degree of curremt document. The result returned is one of these values: 0, 90, 180, 270. More... | |
getScrollWrap () | |
Obtains the scroll wrap instance. More... | |
getSnapMode (stateHandlerName) | |
Obtains the snap mode by state handler name. More... | |
getStateHandlerManager () | |
Get state handler manager. More... | |
getViewModeManager () | |
Get view mode manager. More... | |
highlightForm (highlight) | |
init (selector) | |
Initialize PDFViewer. More... | |
initAnnotationIcons (icons) | |
Set initialized annotation icons. Refer to PDFPage.addAnnot to use those icons. [Not support in Server] More... | |
isLoad3DModuleEnabled () | |
isShortcutKeyEnabled () | |
Get shortcut key settings. More... | |
killFocus () | |
Kill the focus of activated element. More... | |
loadPDFDocByFile (file, options={}) | |
Loads and parses the PDF document stream into PDFDoc instance. More... | |
loadPDFDocByHttpRangeRequest (request, options={}) | |
Loads either a URL document by HTTP range requests or an entire file depending on if the server enables range request or not. More... | |
offShortcutKey (shortcut, handler) | |
Remove an event handler for the given shortcut. More... | |
onShortcutKey (shortcut, handler, preventDefaultImplementation=false) | |
Add an event handler for the given shortcut. Currently we support shortcut keys: Esc: Close dialog or exit edit mode or exit search panel. Home: Jump to the first page. End: Jump to the last page. Delete: Delete selected object. Edit mode: delete the selected text object, non-edit mode: delete the selected annot object. Ctrl+MouseWheelUp: Zoom in the page. Ctrl+MouseWheelDown: Zoom out the page. PageUp: Move current view up. When there is a vertical scroll bar. PageDown: Move current view down. When there is a vertical scroll bar. UpArrow: Move scroll bar up. When there is a vertical scroll bar. DownArrow: Move scroll bar down. When there is a vertical scroll bar. LeftArrow: Move scroll bar the left. When there is a horizontal scroll bar. RightArrow: Move scroll bar to the right. When there is a horizontal scroll bar. Enter: Confirm or continue. Ctrl+Z: Undo. Cmd+Z for Mac. Ctrl+Y: Redo. Cmd+Shift+Z for Mac. Ctrl+MouseLeft: Select multiple objects, annotation, path, text edit. Ctrl+F: Open Search Panel. Cmd+F for Mac. Ctrl+P: Open Print Panel. Cmd+P for Mac. Ctrl+RightArrow: Open Left Navigation Panel. Cmd+RightArrow for Mac. Ctrl+LeftArrow: Close Left Navigation Panel. Cmd+LeftArrow for Mac. Ctrl+C: Copy annotation(path, text edit,image). Cmd+C for Mac. Ctrl+X: Cut annotation(text). Cmd+X for Mac. Ctrl+V: Paste annotation(path, text edit,image). Cmd+V for Mac. . More... | |
openPDFByFile (file, options={}, pdfEngine=this.pdfEngine) | |
Open the local document. More... | |
openPDFByHttpRangeRequest (request, options={fileName:''}, pdfEngine=this.pdfEngine) | |
Open either a URL document by HTTP range requests or an entire file depending on if the server enables range request or not. More... | |
openPDFById (id, options={fileName:''}) | |
Open a document that exists on the server [Server Only]. More... | |
pasteAnnots (datas) | |
Paste annotations into the lower right corner of the center. More... | |
async | print ({ isPortfolio, rangeType, pages=[], printType=['page'], progress, printer, showHeaderFooter=this.getPrintSetting('showHeaderFooter'), quality=this.getPrintSetting('quality')||100, }, callback=noop) |
Prints the current document with specified options. Example: pdfViewer.print({ pages: [0, 1], printType: ['page', 'annot'], quality: 100, showHeaderFooter: false }, function(message) { switch(message.state) { case 'start': console.log('Start generating page images') break; case 'progress': console.log('Page image URI has been generated', message.pageIndex, message.imageURI, message.total) break; case 'end': console.log('Finish generating page images') break; } }) . More... | |
printCurrentView () | |
print the currently displayed screen content. Note: If the printed content is spread across pages, calling this interface can't print any content. More... | |
printEx ({type, pageRange, progress}, callback=noop) | |
Prints the current document with specified options. Example: pdfViewer.printEx({ type: 0, pageRange: "1,2,5-8", }) . More... | |
redraw (force) | |
Redraw the currently visible page(s). More... | |
registerMultimediaPlayers (multimediaPlayers) | |
Register the multimedia players. More... | |
registerPrintHandler (handler) | |
Register print handler. More... | |
registerProgressHandler (callback) | |
Register a progress handler. More... | |
registerSignatureHandler (filter, subfilter, handler) | |
Register a signature handler. [Not support in Server] More... | |
removeAnnotationIcon (type, category, name) | |
Remove an annotation's icon. [Not support in Server] More... | |
renderDoc (pdfDoc, scale=this.config.defaultScale) | |
Render a loaded PDF document. More... | |
reopenPDFDoc (pdfDoc, options={}) | |
When a document fails to open, you can call this method and reproduce the passing parameters to reopen the file that failed to open. More... | |
rotateTo (degree, options) | |
Rotates the current document to the specified degree. This method only changes the rendering of the view and does not change the PDF document data. More... | |
setActionCallback (ActionCallbackClass) | |
Set an ActionCallback class to Web SDK, in aid of performing PDF actions. User should implement a class and call this function to set the action callback to Web SDK. More... | |
setAutoCalculateFieldsFlag (autoCalculate) | |
Provide API to set Automatically Calculate Field Values. More... | |
setDefaultAnnotConfig (fn) | |
Set the default configured callback function for the annotation.See PDFPage::addAnnot for the return object format. More... | |
setDefaultPrintSetting (printSetting) | |
Configures printing parameters. More... | |
setDocReadColors (colors) | |
Sets the background and foreground colors for viewing documents. [Not support in Server] More... | |
setEnableJS (enable) | |
Set whether JavaScript is allowed or not. More... | |
setEnableLoad3DModule (enable) | |
setEnableShortcutKey (enable) | |
Set whether shortcut key is enabled or disabled. More... | |
setEraserSize (width) | |
Sets the width of the eraser. More... | |
setFormatOfDynamicStamp (sperator, timeFormat) | |
Set dynamic information of stamps. [Not support in Server] More... | |
setFormCreationContinuously (isContinuous) | |
Sets whether to keep the current form field to be created continuously. More... | |
setFormFieldFocusRectangleVisible (isVisible) | |
Set whether form field focus rectangle is visible or not. More... | |
setFormHighlightColor (color, requiredColor) | |
setInkSignList (inkSignList) | |
Set ink signature list. More... | |
setJRFontMap (fontMaps) | |
Set JR custom font. [Not support in Server] More... | |
setPencilDrawingTimeOut (millseconds) | |
Sets the timeout for the pencil drawing. A new pencil is created beyond the timeout period. More... | |
setSnapMode (stateHandlerName, mode) | |
Set the snap mode that will be used to calculate the point position. More... | |
setUserName (userName, pdfEngine=this.pdfEngine) | |
Set the global username. More... | |
takeSnapshot (pageIndex, left, top, width, height) | |
Capture the picture of the specified area on the page. More... | |
uploadImage (blob) | |
Upload image blob data to the snapshot server, and then returns a same-origin image URL, which can be used to break some browser's limitations. More... | |
zoomAtPosition (scale, fixedPosition) | |
Scale the page with the point of the fixedPosition as the center. More... | |
zoomTo (scale, position) | |
Zoom to the given scale. More... | |
Public Member Functions inherited from Disposable | |
addDestroyHook (...hooks) | |
destroy () | |
Static Public Member Functions | |
static | module (name, deps) |
alias of Modular.module More... | |
Additional Inherited Members | |
Public Attributes inherited from PDFViewer | |
HTMLElement | element |
A DOM element used to render the stuffs generated in PDFViewer. This element is the DOM node passed by PDFViewer.init method. More... | |
typeof i18next | i18n |
I18next instance. More... | |
|
inline |
Add the custom css fonts.
fonts | string[] - font name {.css} @font-face { font-family: 'Tangerine'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/tangerine/v17/IurY6Y5j_oScZZow4VOxCZZM.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } {.js} function example(pdfui){ pdfui.addCssFonts(["Tangerine"]) } |
|
inline |
Attach an event listener to PDFUI instance by type.
type | string|string[]|{[type:string]:()=>void} - the event type, all event types are defined in UIExtension::UIEvents. |
listener | (...args:any[])=>void - the event callback function |
|
inline |
Attach an event listener to PDFViewer instance by type.
type | string|string[]|{[type:string]:()=>void} - the event type, all event types defined in ViewerEvents. |
listener | (...args:any[])=>void - (Optional if type is a map object)The event callback function. |
|
inline |
Trigger an action to specified Addon.
addonLibrary | string - refer to the 'library' property defined in addon.info.json file of the addon |
action | string - action name |
args | any[] |
addonLibrary | action | args | returns | description | example |
---|---|---|---|---|---|
UndoRedoAddon | undo | - | Promise<void> | Undo last operation that support undo/redo. | pdfui.callAddonAPI("UndoRedoAddon","undo") |
redo | - | Promise<void> | Redo the last undone operation. | pdfui.callAddonAPI("UndoRedoAddon","redo") | |
undoAll | - | Promise<void> | Undo all operations that support undo/redo | pdfui.callAddonAPI("UndoRedoAddon","undoAll") | |
invoke | (pdfDoc: PDFDoc|null)=>Promise<void> | Promise<void> | When using APIs such as PDFPage.addAnnot, PDFPage.removeAnnotById, PDFDoc.addAnnot, Annot.setRect to create, delete, or modify annotations inside this callback, the operation history of these actions will be automatically added to the undo stack, enabling the user to undo these actions if nedded. If no document is currently open, the callback function's pdfDoc parameter value will be null. | pdfui.callAddonAPI('UndoRedoAddon', 'invoke',[ (pdfDoc) => { const pdfPage = pdfDoc.getPageByIndex(0) return pdfPage.addAnnot({...}); } ]); | |
PrintUIXAddon | showPrintDialog | - | Promise<void> | Display the print dialog. | pdfui.callAddonAPI("PrintUIXAddon","showPrintDialog") |
ReadAloudAddon | onActivationChange | (isActivated: boolean) => void | Promise<() => void> - Returns a function to unregister events. | Register events to listen for read-aloud activation | pdfui.callAddonAPI( "ReadAloudAddon", 'onActivationChange', [function(isActivated) { console.info(isActivated ? 'read aloud is activated' : 'read aloud is deactivated'); }] ) |
Thumbnail | zoomTo | number | Promise<boolean> - Boolean value to indicate success or not | Zooming thumbnail of the sidebar. The valid zoomScale value should be between 0 and 10. | pdfui.callAddonAPI('Thumbnail', 'zoomTo', [0.96]) |
Thumbnail | getZoomScale | - | Promise<number> - Current zoom scale value. | Obtains the thumbnail zoom scale value. | pdfui.callAddonAPI('Thumbnail', 'getZoomScale') .then(zoomScale => { console.log('current zoom scale is', zoomScale); }) |
Thumbnail | onSelectThumbnail | (selectedPageIndexes: number[], lastSelectedPageIndexes: number[]) => void; | Promise<() => void> - Returns a function to unregister events. | Register events to listen for selection and de-selection of thumbnail items. | pdfui.callAddonAPI( 'Thumbnail', 'onSelectThumbnail', [(selectedPageIndexes, lastSelectedPageIndexes) => { console.log('current selected page indexes', selectedPageIndexes, 'Last selected page indexes', lastSelectedPageIndexes); }] ) |
DigitalStampUIXAddon | resetIdentityInfo | - | Promise<void> | Reset identity information. | pdfui.callAddonAPI( 'DigitalStampUIXAddon', 'resetIdentityInfo' ) |
DigitalStampUIXAddon | setIdentityInfo | { "surname": "","name": "","title": "","associationName": "","organizationName": ""}- The identity info. | Promise<void> | Set identity information. | pdfui.callAddonAPI( 'DigitalStampUIXAddon', 'setIdentityInfo',[{ "surname": "","name": "","title": "","associationName": "","organizationName": ""}] ) |
DigitalStampUIXAddon | getIdentityInfo | - | Promise<{ "surname": "","name": "","title": "","associationName": "","organizationName": ""}>- The identity info. | Get identity information. | pdfui.callAddonAPI( 'DigitalStampUIXAddon', 'getIdentityInfo' ) .then(info=>console.log(info)) |
DigitalStampUIXAddon | setDigitalStampTemplates | templates - The custom stamp templates. [ { pdfPath:'***.pdf', // The template in PDF format which has at least one special name text field, as follows: surname, name, title, date, associationName, organizationName. name:'custom', //The name of the template. width: 50, //The width of the stamp. height: 50, //The height of the stamp } ... ] | Promise<void>. | Set custom stamp templates. | pdfui.callAddonAPI( 'DigitalStampUIXAddon', 'setDigitalStampTemplates',[ [ { pdfPath:'***.pdf', // The template in PDF format which has at least one special name text field, as follows: surname, name, title, date, associationName, organizationName. name:'custom', //The name of the template. width: 50, //The width of the stamp. height: 50, //The height of the stamp } ... ] ] ) |
DigitalStampUIXAddon | removeDigitalStampTemplates | names - The custom stamp template names. | Promise<void> | Remove custom stamp templates. | pdfui.callAddonAPI( 'DigitalStampUIXAddon', 'removeDigitalStampTemplates' ,[ ['custom'] ] ) |
DigitalStampUIXAddon | getDigitalStampTemplate | - | Promise<templates > - The custom stamp templates. Please refer to the parameters of setDigitalStampTemplates. | Get custom stamp templates. | pdfui.callAddonAPI( 'DigitalStampUIXAddon', 'getDigitalStampTemplate' ) .then(info=>console.log(info)) |
DigitalStampUIXAddon | setTimeFormatOfDigitalStamp | timeFormat {string} - Time format same as parameter of Date.Format. | Promise<void> | Set time format of digital stamps. | pdfui.callAddonAPI( 'DigitalStampUIXAddon', 'setTimeFormatOfDigitalStamp',['YYYY/MM']) |
DigitalStampUIXAddon | setDefaultSize | size {object} - The size of digital stamp. { width: 50, //The width of digital stamp. height: 50 //The height of digital stamp } | Promise<void> | Set the default size of digital stamp. | pdfui.callAddonAPI( 'DigitalStampUIXAddon', 'setDefaultSize',[{width:100,height:100}]) |
CustomDynamicStamp | setDynamicStamp | stampInfo - The custom dynamic stamp information. The width and height indicate the dimension of the stamp icon, and the rect represents the container for the custom text. The size of the rect should always be smaller than the size of the stamp icon, otherwise the stamp text will not appear on screen.Refer to STAMP_TEXT_TYPE for details of textType. [{ category:'xxx', name:'xxx', fileData:'xxx', // The URL of the stamp template, which supports both HTTP and Blob. the template type can be 'bmp','jpg','jpeg','png','tif', and 'tiff'. width:290,//Optional.If the value is empty. the width dimension of the input image will be used. height:150,//Optional.If the value is empty, the height dimension of the input image will be used. field:{ textType:'xxx', // The type of the stamp text. value:'xxx', //The custom text. font:{ //Optional name:'xxx', //Font family. color:0, // Text color. size:18, //Text size. If set, the rect will be recalculated based on top and left }, rect:{ //{ PDFRect } Coordinate system of PDF coordinate system left:0, right:30, top:30, bottom:0, } }, }] | Promise<void> | Set custom dynamic stamp. | |
CustomDynamicStamp | removeDynamicStamp | arr - The custom dynamic stamp category and name. [{ category:'xxx', names:['xxx'] }] | Promise<void> | Remove the custom dynamic stamp. | pdfui.callAddonAPI( 'CustomDynamicStamp', 'removeDynamicStamp',[[{category:'xxx',names:['xxx']}]]) |
CustomDynamicStamp | getDynamicStamp | - | Promise<arr > -The custom dynamic stamp information. | Get the custom dynamic stamp. | pdfui.callAddonAPI( 'CustomDynamicStamp', 'getDynamicStamp') |
|
inline |
Switch UI language.
language | string - language, en-US, zh-CN |
|
inline |
Constructs a PDFUI instance.
options | object - options to create PDFUI |
options.viewerOptions | object - The options for creating PDFViewer; |
options.renderTo | HTMLElement|string - Specifies a target to mount this PDFUI instance, it must be an DOM element or css selector |
[options.appearance=RibbonAppearance] | new(pdfUI:PDFUI)=>Appearance - An appearance instance defines the layout-template, beforeMount/afterMount lifecycle and how to enable/disable components on PDF document opening/closing. Its useful for implementing scenarios that adapt to different UI layouts of different clients. [options.fragments] object[] - UI fragments array, defines serveral UI components and business logics. |
[options.addons] | string|Array<string|UIXAddon> - If string, should be the path of bundle addons' scripts. If array, it's elements should be UIX addons paths or UIXAddon classes [options.template] string - You should rewrite this template option if you want to custom the layout, and if your template parser is not compatible with internal template format, you must rewrite this template otherwise many unpredicatable errors will occur. This parameter is deprecated since version 7.1.1, We are sugested you to use Appearance.getLayoutTemplate now. |
[options.i18n] | object - The options for i18next(an internationalization-framework), for more details please visit https://www.i18next.com/overview/configuration-options |
[options.i18n.absolutePath] | string - The i18n resources directory, relatives to the root directory of your site. |
[options.customs] | object - Some customize options |
[options.customs.getLoadingMode] | (fileOrUrl:File|string)=>number - Callback used to specify loading mode. Please refer to Loading_Mode |
[options.customs.defaultStateHandler] | STATE_HANDLER_NAMES - default state handler name. |
[options.customs.handlerParams] | object - Parameters for state handler, see STATE_HANDLER_NAMES. |
[options.customs.defaultExportCommentsFormat] | string - custom default format of export comments file, it should be the one of 'xfdf', 'fdf' and 'json'; |
[options.customs.scalingValues] | number[] - A list of scaling values, with the default value is [0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 4, 6, 10], that has been used in marquee, loupe and zoom dropdown button in toolbar. The values must be within the minScale and maxScale ranges specified in the PDFViewer.constructor parameters. |
[options.customs.autoDownloadAfterSign] | boolean - True is the default value which means download automatically after signing, otherwise not. |
[options.customs.getSignedDocument] | (pdfBlob: Blob)=>Blob - Get signed document. |
[options.customs.loading] | (coverOn:HTMLElement, text: string, animation: boolean)=>string|Component|HTMLElement|Promise<string|Component|HTMLElement> - A function used to display a custom load layer. This function can return HTML or a layout template, or return component objects. |
[options.customs.progress] | ProgressComponent - Custom progress component for controlling progress. The default progress component will display when the following methods are called: 1. PDFDoc.sign 2. PDFDoc.addWatermark 3. PDFDoc.addAnnots 4. Action: Run Form Recognition on the UI 5. PDFViewer.print: when no custom progress is provided 6. PDFViewer.printEx: when no custom progress is provided |
|
inline |
Destroys a PDFUI instance. The opening document will be closed and all component DOM elements will be destroyed.
|
inline |
Retrieves a loaded UIExtension (UIX) addon instance by its associated library name.
This method allows you to obtain a specific UIX addon instance based on the library name provided. The library name should match the 'library' property defined in the addon.info.json
file of the addon.
addonLibrary | string - The library name of the UIX addon to retrieve. |
|
inline |
Get all components which name is the specific string.
name | string - component name. |
|
inline |
Get Customized icons.
annotType | string - The annotation’s icon type. Currently only ‘stamp’ is available. |
onlyCustomized | boolean - True is for custom stamps only. False means for all icons. |
|
inline |
Obtains the BookmarkUIService instance.
|
inline |
Get the first component which name is the specific string.
name | string - component name. |
|
inline |
Get current language. Usually the language specified in the browser settings, if not supported it defaults to 'en-US'.
|
inline |
Get the PDFViewer instance asynchrounously.
|
inline |
Obtains the root component instance.
|
inline |
Gets the currently selected text information, including the text boundary rectangle in point unit based on the PDF page coordinates, the PDFPage instances and text content. If there's no text is selected, this method returns a none value promise instance. The PDF point unit of the rectangle can be converted to device pixels, as shown in the following example:
.
|
inline |
Obtains the StampService instance.
|
inline |
Overlays a loading modal layer on a specified element.
[coverOn=document.body] | HTMLElement|Component - overlaid element. |
[text=''] | string - The text is positioned below the animated image and supports i18n. |
[animation=true] | boolean|string - Passing boolean to show or hide the animation. Passing string to define the animation using a CSS class. |
|
inlinestatic |
alias of Modular.module
name | string - |
deps | Array<string|UIXModule> - |
|
inline |
Set whether the properties box is displayed when creating a form field.
isOpen | boolean - Specifies whether to show the properties box. pdfui.openFormPropertyBoxAfterCreated(false) |
|
inline |
Register the signature flow handler.
signatureHandler | SignatureFlowOptions - Custom signature process handler. |
|
inline |
Register the signed properties dialog handler .
handler | (signatureInfo: object)=>object - If not passed, the default Dialog will display. { filter:{object}, subfilter:{object} , rect: {PDFRect}, pageIndex: {number}, flag: {number}, signer: {string}, reason: {string}, email: {string}, image: {string}, //such as "data:image/png;base64,....", distinguishName: {string}, location: {string}, textValue: {string}, fieldName: {string}, signTime: {number} } |
|
inline |
Register signing handler.
handler | object - Signing handler. |
handler.filter | string - Filter of this handler. |
handler.subfilter | string - Subfilter of this handler. |
handler.signer | string - Singer name of this handler. |
handler.distinguishName | number - Distinguish name (DN) of signature. |
handler.location | number - Location of signature. |
handler.reason | number - Reason of signature. |
handler.defaultContentsLength | number - 7942 is the default length of signature contents, in bytes. It should not be less than 4098. |
handler.flag | Signature_Ap_Flags - Appearance flags of signature. Please refer to Signature_Ap_Flags. |
handler.sign | (signInfo:object,plainBuffer:ArrayBuffer)=>Promise<ArrayBuffer> - Digest and sign handler. |
handler.timeFormat | object - Customize the date format. |
handler.timeFormat.format | string - The default is 'YYYY.MM.DD HH:mm:ss Z'. |
handler.timeFormat.timeZoneOptions | object - Used if the date format parameter contains 'Z'. |
handler.timeFormat.timeZoneOptions.separator | string - The default is '\''. |
handler.timeFormat.timeZoneOptions.prefix | string - The default is ''. |
handler.timeFormat.timeZoneOptions.showSpace | boolean - The default is 'true'. |
|
inline |
Detach event listener from PDFUI instance by type and its callback function.
type | string|string[] - The event type which passed as the first parameter of PDFUI::addUIEventListener(). |
listener | (...args:any[])=>void - The event callback function passed as the secondary parameter of PDFUI::addUIEventListener(). |
|
inline |
Detach event listener from PDFViewer instance by type and its callback function.
type | string|string[] - The event type which passed as the first parameter of PDFUI.addViewerEventListener(). |
listener | (...args:any[])=>void - The event callback function passed as the secondary parameter of PDFUI.addViewerEventListener(). |
|
inline |
Set the default scale ratio for measuring.
options | object - options of measurement information |
options.userSpaceScaleValue | number - Set the ratio value in user space. |
options.userSpaceUnit | string - Set the ratio unit in user space. Only 'inch,pt,cm,mm,pica' types are supported. Please refer to Annot_Unit_Type |
options.realScaleValue | number - Set the ratio value in real space. |
options.realUnit | string - Set the ratio unit in real space. Please refer to Annot_Unit_Type |
|
inline |
Override the builtin interaction class, and customize the behavior of the snapshot tool buttons.
interactionClass | new(pdfViewer: PDFViewer, snapshot: Snapshot)=>SnapshotInteraction - A class inherits from SnapshotInteraction. |
|
inline |
Register signature verifying handler.
handler | (field:PDFField,plainBuffer:Uint8Array,signedData:Uint8Array)=>Promise<number> - Verifying handler which will return signature's state. Please refer to Signature_State. |
|
inline |
A method returns a Promise instance that will be fullfilled after PDFUI completes initialization.