FoxitPDFSDKforWeb
v10.0.0
Foxit PDF SDK for Web
|
Use PDFViewCtrl for the entry file. More...
Public Member Functions | |
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 () | |
Public Attributes | |
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... | |
Use PDFViewCtrl for the entry file.
|
inline |
Jumps to and activates a specified annotation with an option determining if to expand the comment list.
options | Object |
options.annotationId | string|number - The annotation ID. It is recommended to use object number. |
options.pageIndex | number - The page index where the annotation exists. |
[options.showCommentList=false] | boolean - Sets whether the comment list should initially open. True value is to open the comment list. This option is only valid for annotations associated with a Popup entry. |
|
inline |
Activates an activatable object;.
element | Activatable |
|
inline |
Add an annotation icon. [Not support in Server]
icon | object - The annotation's icon. |
[icon.fileType] | string - The icon's type. It supports png, jpeg, jpg, pdf, bmp. |
[icon.url] | string - The icon file's URL. It supports HTTP, blob url and base64 url. |
[icon.annotType] | string - The annotation's type. |
[icon.category] | string - The icon's category. |
[icon.name] | string - The icon's name which is a unique identifier. |
[icon.width] | number - The icon's width. |
[icon.height] | number - The icon's height. |
|
inline |
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.
fontMaps | Array<object> - Custom fonts. |
fontMap | object - The font information |
fontMap.name | string - The font face name. |
fontMap.style | number - The font styles. Please refer to Font_Styles . |
fontMap.charset | number - The charset of the font. Please refer to Font_Charset or Font_CIDCharset . |
|
inline |
Close the open document.
[before] | Function - Callback before closing the document, support Promise, do not close the document when returning false. The default value is the PDFViewer initialization parameter customs.closeDocBefore. |
[after] | Function - The callback after closing the document. The default value is the PDFViewer initialization parameter customs.closeDocAfter. |
|
inline |
Compare this PDFDoc with the otherDoc
, and then generate a PDFDoc as comparison result.
baseDocId | string - The base document id. |
otherDocId | string - The other document id. |
params | object - comparison options. |
params.basePageRange | ComparePageRange - Range of this document pages for comparison. |
params.otherPageRange | ComparePageRange - Range of other document pages for comparison |
[params.baseFileName] | string - This pdf document file name. This name will be displayed in the comparison result document, by default the file name of this document is used. |
[params.otherFileName] | string - Other pdf document file name. This name will be displayed in the comparison result document, by default the file name of other document is used |
[params.resultFileName] | string - The filename of the comparison result document. |
[params.options] | object - Comparison options. |
[params.options.textOnly=false] | boolean - Compare text only. The default is false. |
[params.options.detectPage=false] | boolean - Detect page deletions or inserts. The default is false. |
[params.options.compareTable=false] | boolean - Compare table |
[params.options.markingColor] | MarkingColorValues - Marking colors of each compare type objects. |
[params.options.markingColor.delete] | number - delete marking color. |
[params.options.markingColor.insert] | number - insert marking color. |
[params.options.markingColor.replace] | number - replace marking color. |
[params.options.lineThickness] | LineThicknessValues - line thickness of each compare type objects. |
[params.options.lineThickness.delete] | number - delete line thickness. |
[params.options.lineThickness.insert] | number - insert line thickness. |
[params.options.lineThickness.replace] | number - replace line thickness. |
[params.options.opacity] | OpacityValues - Opacity of each compare type objects. |
[params.options.opacity.delete] | number - delete annot transparency. |
[params.options.opacity.insert] | number - insert annot transparency. |
[params.options.opacity.replace] | number - replace annot transparency. |
onprogress | (currentRate:number)=>void - |
|
inline |
Create a PDFViewer.
options | object - The configuration required to create the PDFViewer. |
options.jr | object - JR engine config. [Not support in Server] |
[options.jr.licenseKey] | string - String of licenseKey information. |
[options.jr.licenseSN] | string - String of licenseSN information. |
[options.jr.l] | string - String of license information. If he is assigned a value, neither jr.licenseKey nor jr.licenseSN is valid |
[options.jr.workerPath=options.libPath] | string - The JR engine worker path. If it's a relative path, it's relative to "options.libPath". If it's url, it's url. |
[options.jr.enginePath=options.libPath+'jr-engine'] | string - The JR engine path. If it's a relative path, it's relative to "options.libPath". If it's url, it's url. |
[options.jr.fontPath='../external/brotli'] | string - The JR engine render fonts path. If it's a relative path, it's relative to "options.libPath". If it's url, it's url. If you don't want the font resources under external/brotil, you can use the fonts on our server by configuring http://webpdf.foxitsoftware.com/webfonts |
[options.jr.fontInfoPath] | string - The url of the fonts information file. |
[options.jr.readBlock=8192] | number - Size of each read block. default 8192 = 8 *1024 = 8KB |
[options.jr.brotli] | object - brotli config |
[options.jr.brotli.core] | boolean - This parameter is used to set whether to use brotli compression or not. This is specially useful on a legacy browser but with high-speed network. True is the default value which means to enable the brotli loading. |
[options.preloadJR=true] | boolean - Preload JR engine. [Not support in Server] |
[options.libPath] | string - DFViewer lib package path. The default is the current page path. |
[options.minScale=0.01] | number - Minimum magnification |
[options.maxScale=10] | number - Maximum magnification |
[options.defaultScale='fitWidth'] | number|string - Multiple of the default display. string enum: fitWidth, fitHeight |
[options.scaleFrequency=0] | number - Set integers greater than or equal to 0. It will affect page rendering. The default value is 4, then 1/4=0.25, such as 1.1 times, is 1.25 times the size of the picture to reduce drawing overhead. The larger the value, the clearer it is, but the higher the performance penalty. If the value is set to 0, it is rendered in raw multiples, not scaled. The biggest performance penalty. |
[options.tileSize=1200] | number - Deprecated. Starting in version 8.5, this option has been deprecated. |
[options.tileCache=2] | boolean|number - If the tile caching is enabled, tiles that scroll outside the viewport are retained, while if positive, the number of tiles scrolling outside the window is retained the corresponding number of pages is retained, if it is not positive, it is disabled, while if disabled, tiles scrolling outside the viewport will be cleared and need to be re-rendered. Clearing the cache can reduce the rendering quality, but save memory. |
[options.getTileSize=null] | Function - Deprecated. Starting in version 8.5, this option has been deprecated. |
[options.annotRenderingMode] | object - Deprecated. Starting in version 8.5, this option has been deprecated. By default, Foxit PDF SDK for Web uses the native mode (using WebAssembly as the rendering engine) to render annotations and form controls. |
[options.i18n] | typeof i18next - 18next instance https://www.i18next.com/ |
[options.i18nOptions] | object - If options.i18n does not exist, options.i18n is generated through the options.i18nOptions configuration |
[options.i18nOptions.initOption={ns:'viewer_'}] | object - Multilingual config. https://www.i18next.com/overview/configuration-options |
[options.i18nOptions.path=options.libPath+'locales'] | string - Multilingual path. If it's a relative path, it's relative to options.lib. If it's url, it's url. |
[options.eventEmitter] | EventEmitter - default: new EventEmitter(); eventemitter3 https://github.com/primus/eventemitter3 |
[options.Viewmodes=[]] | Array<new(pdfDocRender: PDFDocRender)=>IViewMode> - View mode component. |
[options.defaultViewMode='continuous-view-mode'] | string - The default view mode to display PDF pages. Available view mode name literals: 'continuous-view-mode','single-page-view-mode', and the name of options.Viewmodes. 'facing-page-view-mode', 'h-continuous-view-mode' and 'facing-continuous-page-view-mode' are defined in h-continuous uix addon, it works in UIExtension module only! |
[options.defaultAnnotConfig=function(type,intent){}] | Function - Gets the default configured callback for the annotation.See PDFPage::addAnnot for the return object format. |
[options.customs] | object - Custom component. |
[options.customs.closeDocBefore=function(){}] | Function - Callback before closing the document, support Promise, do not close the document when returning false. |
[options.customs.closeDocAfter=function(){}] | Function - Callback after closing the document, support Promise. |
[options.customs.getDocPermissions=(doc:PDFDoc)=>-1] | Function - Get custom user access permissions. -1 represents all permissions. Please refer to User_Permissions |
[options.customs.getAdditionalPerm=(doc:PDFDoc)=>-1] | Function - Get additional permissions. Please refer to Additional_Permission. |
[options.customs.getAnnotPermissions=(annot:Annot)=>Promise.resolve()] | Function - A function used to generate a permission list(Refer to PDFViewCtrl.constants.ANNOTATION_PERMISSION ) base on the annotation information. The application can control the permissions of each annotation according to actual needs through this function. |
[options.customs.ScrollWrap=ScrollWrap] | new(...args:any[])=>ScrollWrap - The component that controls the roll. |
[options.customs.PDFViewerRendering] | PDFViewerRendering - Called when the viewer rendering. |
[options.customs.PDFDocRendering] | PDFDocRendering - Called when the doc rendering. |
[options.customs.PDFPageRendering] | PDFPageRendering - Called when the page rendering. |
[options.customs.AnnotTooltip] | AnnotTooltip - The component that controls the tooltip. |
[options.customs.beforeRenderPDFDoc] | (pdfDoc:PDFDoc)=>Promise<void> - Called before render PDF document when opening file. |
[options.customs.getAnnotComponentConfig=function(){}] | (annotComponent:AnnotComponent, props:Array<String>)=>object - Configure configuration items for the AnnotComponent. The details of the configuration items refer to the AnnotComponentConfig. This can be set using CustomOptionsUpdater.updateGetAnnotComponentConfig. js viewerOptions: { customs: { getAnnotComponentConfig: function (annotComponent, props) { let annot = annotComponent.getModel(); if (annot.getType() !== 'stamp') { return; } let config = {}; props.forEach(function (key) { switch (key) { case 'resizable': config[key] = false; break; } }) return config; } } } }) |
[options.customs.storageDriver] | StorageDriver - Custom storage driver instance. |
[options.customs.syncTextScaling=false] | boolean - Determines whether the text size inside the free text box/callout should scale synchronously with outer container. |
[options.StateHandlers=[]] | IStateHandler[] - pdf viewer state handler. |
[options.enableShortcutKey=true] | boolean - Enable or disable shortcut key. |
[options.noJSFrame=false] | boolean - Specifies whether using a iframe DOM to run PDF JS. True means PDF JS is running in a separated iframe DOM. Otherwise running in same frame.If multiple PDFViewer instances exist at the same time, this parameter will be forced to false . |
[options.showCommentList=false] | boolean - Specifies whether commentList pops up after add a new markup annotation. |
[options.showAnnotTooltip=false] | boolean - Specifies whether a Tooltip is used or not used. |
[options.showFormFieldTooltip=false] | boolean - Specifies whether a Tooltip is used or not used for form fields. |
[options.collaboration] | object - Specify collaboration parameters. Deprecated. Starting in version 8.5.2, this option has been deprecated. Using Foxit web collaboration add-on instead. Please refer to https://webviewer-demo.foxit.com/docs/collab-developer-guide/ for more details. |
[options.collaboration.enable] | boolean - Whether to enable collaboration. Deprecated. Starting in version 8.5.2, this option has been deprecated. |
[options.collaboration.communicator] | CollaborationCommunicator - A communicator used to communicat with the server. Deprecated. Starting in version 8.5.2, this option has been deprecated. |
[options.collaboration.continueToConnect] | (retryTimes:number, shareId:string)=>boolean - A callback used to detect whether to reconnect more times on connection losted! Deprecated. Starting in version 8.5.2, this option has been deprecated. |
[options.viewerUI] | IViewerUI - Used to customize the UI components that needed within the PDFViewer |
[options.snapshotServer] | SnapshotServer - Used to customize screenshot image storage service |
[options.showMeasurementInfoPanel=true] | boolean - Specifies whether the measurement information panel pops up after activate an measurement. |
[options.instanceId] | String - The ID of the instance used to differentiate between multiple instances. This is typically used to isolate storage space for different instances. This parameter is optional. When instanceId is not specified, the SDK will automatically generate an instanceId based on the creation order of PDFViewer. If instanceId is specified, it will be checked for duplicates. If there are any PDFViewer instances that have not been destroyed and are using the same instanceId, an exception will be thrown. If there are no duplicates, the specified instanceId will be used |
[options.messageSyncServiceWorker] | object - Options for customizing the configuration of the service worker that will be used for SDK internal communication. This was added in version 10.0.0. |
[options.messageSyncServiceWorker.registration] | Promise<ServiceWorkerRegistration> - A Promise that resolves with a ServiceWorkerRegistration object returned from navigator.serviceWorker.register . |
[options.messageSyncServiceWorker.url] | string - The URL of the service worker script, If registration option is provided, this option will be omitted. |
[options.messageSyncServiceWorker.options] | RegistrationOptions - An object containing registration options(https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#options), If the registration is provided, this option will be omitted. |
|
inline |
An API to get coordinate information for the PDF coordinate system from device coordinates.
clientX | number - the X-axis offset in the upper-left corner of the browser view. |
clientY | number - the Y-axis offset in the upper-left corner of the browser view. |
|
inline |
Convert image to PDF document from file or url, supported image types are bmp/jpeg/png/gif. [Not support in Server]
file | File|Blob|ArrayBuffer - File stream of image file, if it is null or undefined, the parameter 'url' will be used. |
url | string - Request the url of the file, this parameter would be ignore if parameter 'file' is valid. It's the second parameter to XMLHttpRequest.open,this URL is relative to the path of your HTML page. |
title | string - New pdf title, default value is "untitled.pdf". |
author | string - New Pdf author. |
[options] | object - reserved. |
[pdfEngine] | any - If you have a custom engine, pass it here. |
|
inline |
Copy Annotations. No copy in the clipboard.
annots | Array<Annot> - |
|
inline |
Copy image data to clipboard via dataURL.
dataURL | string - Image data URL |
|
inline |
Create a new pdf document. [Not support in Server]
title | string - New pdf title, default value is "untitled.pdf". |
author | string - New Pdf author. |
[pageSize={height:842,width:595}] | {height:number,width:number} - default: {height:842, width:595}. |
[options={isRenderOnDocLoaded:true}] | object - Whether to render the document when it has been loaded. |
[options.isRenderOnDocLoaded=true] | boolean - |
[pdfEngine] | any - If you have a custom engine, pass it here |
|
inline |
Deactives an activatable object;.
element | Activatable |
|
inline |
Obtains the ActionCallbackManager.
|
inline |
|
inline |
|
inline |
Get annotation component manager.
|
inline |
Get annot render. PDFPageRender::getAnnotRender.
pageIndex | number - page index |
name | string|number - annotation name, It is recommended to use object number. |
|
inline |
Obtains the BookmarkDataService instance for managing bookmark data.
This method provides access to the singleton instance of BookmarkDataService, allowing for the management and manipulation of bookmark-related data.
|
inline |
Get current pdf doc object.
|
inline |
Retrieves the CustomOptionsUpdater instance for updating custom options dynamically.
|
inline |
Get the callback function which is used to configure the default settings for the annotations.
|
inline |
Checks if PDF js can be executed. [Not support in Server]
|
inline |
Get event emitter.
|
inline |
Get the highlight color for form field.
|
inline |
Get ink signature list.
type | string - Custom format of export the ink signature, it should be the one of 'base64' and 'blob'; The default value is 'base64'. |
|
inline |
Get the unique instance ID.
The value of this ID is dependent on the construction order of the PDFViewer instance by default. After page reload, this value remains unchanged.
|
inline |
Obtains the OverlayComparisonOptionsService, which will be used to configure and share overlay-comparison options between multiple PDFViewer instances and to monitor option changes.
|
inline |
Obtains the OverlayComparisonService instance, which includes the built-in overlay comparison function.
|
inline |
Convert image file to PDFdoc object supported image types are bmp/jpeg/png/gif.
|
inline |
GetPDFDocRender.
|
inline |
GetPDFPageRender PDFDocRender::getPDFPageRender.
index | number - page index |
|
inline |
|
inline |
Obtains the rotation degree of curremt document. The result returned is one of these values: 0, 90, 180, 270.
|
inline |
|
inline |
Obtains the snap mode by state handler name.
stateHandlerName | string - State handler name which supports snap mode:
|
|
inline |
Get state handler manager.
|
inline |
Get view mode manager.
|
inline |
Sets if to highlight the form or not. [Not support in Server]
highlight | boolean - Specifies whether the form field should be highlighted or not. true for showing highlight color. false for not showing. |
|
inline |
|
inline |
Set initialized annotation icons. Refer to PDFPage.addAnnot to use those icons. [Not support in Server]
icons | Array - Icons for annotations |
[icons.annotType='stamp'] | string - The annotation's type, currently only 'stamp' available |
icons.category | string - The icon's category. |
icons.name | string - The icon's name which is a unique identifier. |
icons.fileType | string - The icon's type. It supports bmp, jpg, jpeg, png, tif, tiff, pdf. |
icons.url | string - The icon file's URL. It supports HTTP, blob url and base64 url. Relative path and absolute path are not supported. |
[icons.width=150] | number - The icon's width in PDF coordinates, default:150 |
[icons.height=45] | number - The icon's height in PDF coordinates, default: 45. |
|
inline |
Get whether the 3D module is enabled to be loaded.
|
inline |
Get shortcut key settings.
|
inline |
Kill the focus of activated element.
|
inline |
Loads and parses the PDF document stream into PDFDoc instance.
file | File|Blob|ArrayBuffer|TypedArray|DataView - File stream of PDF document |
options | object |
[options.password] | string - document password |
[options.encryptPassword] | string - The document's password is encrypted again. You can refer to the logic of path 'server/encrypt-password' to get your encryptPassword [Not support in Server] |
[options.fileName=''] | string - document filename |
[options.readBlock] | number - Size of each read block. default equals options.jr.readBlock. [Not support in Server] |
[options.errorHandler] | (doc:PDFDoc,options:object,error:any|undefined,retry:(options:object)=>Promise<PDFDoc|undefined>)=>Promise<PDFDoc|undefined> - An optional callback function for handling exceptions. When a password error occurs, you can use this callback function to accept a new password and continue to open the document. |
[options.drm] | object - When this value is set, the DRM decryption process is invoked. [Not support in Server] |
[options.drm.isEncryptMetadata] | boolean - A boolean value to decide whether to encrypt metadata or not. true means to encrypt metadata, and false means not to encrypt metadata. |
[options.drm.subFilter] | string - The sub filter of PDF document. |
[options.drm.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. |
[options.drm.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. |
[options.drm.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. |
[options.drm.userPermissions] | number - The user permissions. Please refer to values starting from User_Permissions::print and this can be one or combination of these values. |
[options.drm.fileId] | string - The file identity string. |
[options.drm.initialKey] | string - The user specified initial key for encryption. |
[options.fileOpen] | object - When this value is set, the fileOpen decryption process is invoked. [Not Support in Server] |
[options.fileOpen.encryptKey] | string[] - Decrypt an array of charcodes for the key |
[options.fileOpen.cipher] | Cipher_Type[] - The cipher type. Default: Cipher_Type::cipherRC4 , Please refer to values starting from Cipher_Type::cipherRC4 and this should be one of these values except Cipher_Type.cipherNone |
[options.jwt] | Function - Invalid parameter Must be filled when JWT calibration is enabled. [Server Only] |
|
inline |
Loads either a URL document by HTTP range requests or an entire file depending on if the server enables range request or not.
request | object |
request.range | object - HTTP range requests, responseType = 'arraybuffer'. |
request.range.url | string - Request the url of the file. The second parameter to XMLHttpRequest.open, default request.range.url, this URL is relative to the path of your HTML page. |
[request.range.type='GET'] | number - The first parameter to XMLHttpRequest.open, default GET. |
[request.range.user] | number - The fourth parameter to XMLHttpRequest.open. |
[request.range.password] | number - The fifth parameter to XMLHttpRequest.open. |
[request.range.headers] | object - Set the request header for XMLHttpRequest. eg: XMLHttpRequest.setRequestHeader(x, request.header.headers.x). |
[request.range.chunkSize=131072] | number - Size of each Range sharding request. default 131072 = 128 *1024 = 128KB. [Not support in Server] |
[request.range.extendOptions] | string - Set the response header to get additional options. [Not support in Server] |
[request.size] | number - The size of the document. [Not support in Server] |
options | object |
[options.password] | string - Document password. |
[options.encryptPassword] | string - The document's password is encrypted again. You can refer to the logic of path 'server/encrypt-password' to get your encryptPassword. [Not support in Server] |
[options.fileName=''] | string - Document filename. |
[options.readBlock] | number - Size of each read block. default equals options.jr.readBlock. [Not support in Server] |
[options.errorHandler] | (doc:PDFDoc,options:object,error:any|undefined,retry:(options:object)=>Promise<PDFDoc|undefined>)=>Promise<PDFDoc|undefined> - An optional callback function for handling exceptions. When a password error occurs, you can use this callback function to accept a new password and continue to open the document. |
[options.drm] | object - When this value is set, the DRM decryption process is invoked. [Not support in Server] |
[options.drm.isEncryptMetadata] | boolean - A boolean value to decide whether to encrypt metadata or not. true means to encrypt metadata, and false means not to encrypt metadata. |
[options.drm.subFilter] | string - The sub filter of PDF document. |
[options.drm.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. |
[options.drm.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. |
[options.drm.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. |
[options.drm.userPermissions] | number - The user permissions. Please refer to values starting from User_Permissions::print and this can be one or combination of these values. |
[options.drm.fileId] | string - The file identity string. |
[options.drm.initialKey] | string - The user specified initial key for encryption. |
[options.fileOpen] | object - When this value is set, the fileOpen decryption process is invoked. [Not Support in Server] |
[options.fileOpen.encryptKey] | string[] - Decrypt an array of charcodes for the key. |
[options.fileOpen.cipher] | Cipher_Type[] - The cipher type. Default: Cipher_Type::cipherRC4 , Please refer to values starting from Cipher_Type::cipherRC4 and this should be one of these values except Cipher_Type.cipherNone |
[options.jwt] | Function - Invalid parameter. Must be filled when JWT calibration is enabled. [Server Only] |
|
inline |
Remove an event handler for the given shortcut.
shortcut | string - A keyboard shortcut key. |
[handler] | Function|object - If not passed, all handlers of the given shortcut will be removed. |
|
inline |
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.
.
shortcut | string - A keyboard shortcut key. |
handler | Function|object - If it is a function, it will be called on keyup. If it is an object, it should have the format of { keydown: func1, keyup: func2 } or { keydown|keyup: func }. |
[preventDefaultImplementation] | boolean - If true, prevent default implementation. The default is false. |
|
inline |
Open the local document.
file | File|Blob|ArrayBuffer|TypedArray|DataView - File stream of PDF document.
| ||||||||||||
[options={fileName:''}] | object | ||||||||||||
[options.isRenderOnDocLoaded=true] | boolean - Whether to render the document once it has been loaded. | ||||||||||||
[options.beforeRenderPDFDoc] | (pdfDoc:PDFDoc)=>Promise<void> - A callback function used to load/import data before render PDF file. If this option is passed, the isRenderOnDocLoaded will be ignored. The default value is this.customs.beforeRenderPDFDoc. | ||||||||||||
[options.password] | string - Document password. | ||||||||||||
[options.encryptPassword] | string - The document's password is encrypted again. You can refer to the logic of path 'server/encrypt-password' to get your encryptPassword [Not support in Server] | ||||||||||||
[options.fileName=''] | string - The file name of the document. | ||||||||||||
[options.readBlock] | number - Size of each read block. default equals options.jr.readBlock. [Not support in Server] | ||||||||||||
[options.annotsJson] | Record<string, any> - Json format data for the initial annotation [Not support in Server] | ||||||||||||
[options.fdf] | object - FDF file containing the initial annotation data. [Not support in Server] | ||||||||||||
[options.fdf.file] | File|Blob|ArrayBuffer|TypedArray|DataView - Specify fdf file's stream for the initial annotation. | ||||||||||||
[options.fdf.type] | number - Specify data type which will be imported: 1 for form data, 2 for annotations. | ||||||||||||
[options.drm] | object - When this value is set, the DRM decryption process is invoked. [Not support in Server] | ||||||||||||
[options.drm.isEncryptMetadata] | boolean - A boolean value to decide whether to encrypt metadata or not. True means to encrypt metadata, and false means not to encrypt metadata. | ||||||||||||
[options.drm.subFilter] | string - The sub filter of PDF document. | ||||||||||||
[options.drm.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. | ||||||||||||
[options.drm.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. | ||||||||||||
[options.drm.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. | ||||||||||||
[options.drm.userPermissions] | number - The user permissions. Please refer to values starting from User_Permissions::print and this can be one or combination of these values. | ||||||||||||
[options.drm.fileId] | string - The file identity string. | ||||||||||||
[options.drm.initialKey] | string - The user specified initial key for encryption. | ||||||||||||
[options.fileOpen] | object - When this value is set, the fileOpen decryption process is invoked. [Not Support in Server] | ||||||||||||
[options.fileOpen.encryptKey] | string[] - Decrypt an array of charcodes for the key | ||||||||||||
[options.fileOpen.cipher] | Cipher_Type[] - The cipher type. Default: Cipher_Type::cipherRC4 , Please refer to values starting from Cipher_Type::cipherRC4 and this should be one of these values except Cipher_Type.cipherNone | ||||||||||||
[options.jwt] | Function - Invalid parameter Must be filled when JWT calibration is enabled. [Server Only] |
|
inline |
Open either a URL document by HTTP range requests or an entire file depending on if the server enables range request or not.
request | object |
request.range | object - HTTP range requests, responseType = 'arraybuffer' |
request.range.url | string - Request the url of the file. The second parameter to XMLHttpRequest.open, default request.range.url, this URL is relative to the path of your HTML page. |
[request.range.type='GET'] | number - The first parameter to XMLHttpRequest.open, default GET |
[request.range.user] | number - The fourth parameter to XMLHttpRequest.open |
[request.range.password] | number - The fifth parameter to XMLHttpRequest.open |
[request.range.headers] | object - Set the request header for XMLHttpRequest. eg: XMLHttpRequest.setRequestHeader(x, request.header.headers.x) |
[request.range.chunkSize=131072] | number - Size of each Range sharding request. default 131072 = 128 *1024 = 128KB [Not support in Server] |
[request.range.extendOptions] | string - Set the response header to get additional options [Not support in Server] |
[request.size] | number - the size of the document [Not support in Server] |
[options={fileName:''}] | object |
[options.isRenderOnDocLoaded=true] | boolean - Whether to render the document once it has been loaded. |
[options.beforeRenderPDFDoc] | (pdfDoc:PDFDoc)=>Promise<void> - A callback function used to load/import data before render PDF file. If this option is passed, the isRenderOnDocLoaded will be ignored. The default value is this.customs.beforeRenderPDFDoc |
[options.password] | string - document password |
[options.encryptPassword] | string - The document's password is encrypted again. You can refer to the logic of path 'server/encrypt-password' to get your encryptPassword. [Not support in Server] |
[options.fileName=''] | string - document filename |
[options.readBlock] | number - Size of each read block. default equals options.jr.readBlock. [Not support in Server] |
[options.annotsJson] | object - Json format data for the initial annotation [Not support in Server] |
[options.fdf] | object - FDF file containing the initial annotation data. [Not support in Server] |
[options.fdf.file] | File|Blob|ArrayBuffer|TypedArray|DataView - Specify fdf file's stream for the initial annotation. |
[options.fdf.type] | number - Specify data type which will be imported: 1 for form data, 2 for annotations. |
[options.drm] | object - When this value is set, the DRM decryption process is invoked. [Not support in Server] |
[options.drm.isEncryptMetadata] | boolean - A boolean value to decide whether to encrypt metadata or not. true means to encrypt metadata, and false means not to encrypt metadata. |
[options.drm.subFilter] | string - The sub filter of PDF document. |
[options.drm.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. |
[options.drm.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. |
[options.drm.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. |
[options.drm.userPermissions] | number - The user permissions. Please refer to values starting from User_Permissions::print and this can be one or combination of these values. |
[options.drm.fileId] | string - The file identity string. |
[options.drm.initialKey] | string - The user specified initial key for encryption. |
[options.fileOpen] | object - When this value is set, the fileOpen decryption process is invoked. [Not support in Server] |
[options.fileOpen.encryptKey] | number[] - Decrypt an array of charcodes for the key |
[options.fileOpen.cipher] | string[] - The cipher type. Default: Cipher_Type::cipherRC4 , Please refer to values starting from Cipher_Type::cipherRC4 and this should be one of these values except Cipher_Type.cipherNone |
[options.jwt] | Function - Invalid parameter Must be filled when JWT calibration is enabled. [Server Only] |
|
inline |
Open a document that exists on the server [Server Only].
id | string - The document ID stored by the server |
options={fileName:''} | object |
[options.isRenderOnDocLoaded=true] | boolean - Whether to render the document once it has been loaded. |
[options.password] | string - document password |
[options.fileName=''] | string - document filename |
[options.jwt] | Function - Invalid parameter Must be filled when JWT calibration is enabled. [Server Only] |
|
inline |
Paste annotations into the lower right corner of the center.
datas | object[] - Annots information. |
|
inline |
Prints the current document with specified options. Example:
.
options | object |
options.pages | Array<number | { pageIndex: number; rect?: { x: number; y: number; width: number; height: number } }> - If the type is number, will be printed specified pages by parameter. If the parameter type is object and the rect attribute isn't empty, print the specified area on page, else rect attribute is empty, same as parameter type is number. |
options.printType | string[] - Represents the content type to print. It includes "page" and "annot". The default one is "page" |
options.progress | ProgressComponent | boolean - Represents the print progress bar. True is the default value which means to show the progress bar. False is the opposite. To customize the progress bar UI, you can pass a custom ProgressComponent object. |
options.quality | number - Represents the print quality which is calculated in percentage. The valid range is 100~1000. |
options.showHeaderFooter | boolean - Represents to show or hide the Header&Footer. True is the default value which means to print with header & footer. False means the opposite. This option is only available on Chrome, FireFox and Chromium Edge. |
callback | (data: {state: 'start'} | {state: 'progress', pageIndex:number, total:number, imageURI:string} | {state: 'end', result:{[pageIndex:number]:string}})=>void - This callback will be triggered when the print state got changed! |
|
inline |
print the currently displayed screen content. Note: If the printed content is spread across pages, calling this interface can't print any content.
|
inline |
Prints the current document with specified options. Example:
.
options | object |
options.type | number - Represents the content type to print. 0: print document 1: print document and markups 2: print document and stamps 3: print form fields only |
options.pageRange | string - Print the pages by the specified page numbers. such as: "1,2,5-8", include the page number 8 |
options.progress | ProgressComponent | boolean - Represents the print progress bar. True is the default value which means to show the progress bar. False is the opposite. To customize the progress bar UI, you can pass a custom ProgressComponent object. |
callback | (data: {state: 'start'} | {state: 'progress', progress: number} | {state: 'end'})=>void - This callback will be triggered when the print state got changed! |
|
inline |
Redraw the currently visible page(s).
[force=false] | boolean - true: This will also refresh the cache. |
|
inline |
Register the multimedia players.
multimediaPlayers | Array<MultimediaPlayer> - The custom multimedia players. |
|
inline |
Register print handler.
handler | RegisterPrintHandlerCallback - Print handler. |
|
inline |
Register a progress handler.
callback | (taskType,progress,status)=>void |
callback.taskType | string - The task type. |
callback.progress | number|Object - This parameter can be either a number or an object. If it is a number, it represents the overall progress of the task as a percentage. If it is an object, it has two properties: current and total, which represent the current progress and total progress of the task, respectively. |
callback.progress.current | number - This property represents the current progress of the task. |
callback.progress.total | number - This property represents the total progress of the task. |
callback.status | string - This parameter indicates the current status of the task progress. It should be one of the values defined in the PROGRESS_STATUS constant. |
|
inline |
Register a signature handler. [Not support in Server]
filter | string - Filter of signature handler. |
subfilter | string - Subfilter of signature handler. |
handler | object - An object specify http api to sign and verify signatures. |
[handler.sign] | string - An object specify server api to sign and verify signatures. |
[handler.verify] | string - An object specify server api to sign and verify signatures. |
|
inline |
Remove an annotation's icon. [Not support in Server]
type | string - The annotation's icon type. Currently only 'stamp' is available. |
category | string - The category's icon. If null, all icons will be removed. |
name | string - The icon's name. If null, all icons in specified category will be removed. |
|
inline |
Render a loaded PDF document.
pdfDoc | PDFDoc - The PDF document object, which is returned by open functions such as openPDFByFile and openPDFById etc. |
scale | number|string - The multiple of the default display. String enum:fitWidth and fitHeight. |
|
inline |
When a document fails to open, you can call this method and reproduce the passing parameters to reopen the file that failed to open.
pdfDoc | PDFDoc |
[options] | object |
[options.isRenderOnDocLoaded=true] | boolean - Whether to render the document once it has been loaded. |
[options.beforeRenderPDFDoc] | (pdfDoc:PDFDoc)=>Promise<void> - A callback function used to load/import data before render PDF file. If this option is passed, the isRenderOnDocLoaded will be ignored. The default value is this.customs.beforeRenderPDFDoc |
[options.password] | string - document password |
[options.encryptPassword] | string - The document's password is encrypted again. You can refer to the logic of path 'server/encrypt-password' to get your encryptPassword [Not Support in Server] |
[options.fileName=''] | string - document filename |
[options.annotsJson] | object - Json format data for the initial annotation [Not Support in Server] |
[options.fdf] | object - Json format data for the initial annotation [No Support in Server] |
[options.fdf.file] | File|Blob|ArrayBuffer|TypedArray|DataView - Specify fdf file's stream for the initial annotation. |
[options.fdf.type] | number - Specify data type which will be imported: 1 for form data, 2 for annotations. |
[options.jwt] | Function - Invalid parameter Must be filled when JWT calibration is enabled. [Server Only] |
[options.drm] | object - When this value is set, the DRM decryption process is invoked. [Not Support in Server] |
[options.drm.isEncryptMetadata] | boolean - A boolean value to decide whether to encrypt metadata or not. true means to encrypt metadata, and false means not to encrypt metadata. |
[options.drm.subFilter] | string - The sub filter of PDF document. |
[options.drm.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. |
[options.drm.keyLength] | number - The key length, in bytes. For SecurityConstsPDF::cipherRC4 cipher, this value should be between 5 and 16. For SecurityConstsPDF::cipherAES cipher, this value should be 16 or 32. |
[options.drm.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. |
[options.drm.userPermissions] | number - The user permissions. Please refer to values starting from User_Permissions::print and this can be one or combination of these values. |
[options.drm.fileId] | string - The file identity string. |
[options.drm.initialKey] | string - The user specified initial key for encryption. |
[options.fileOpen] | object - When this value is set, the fileOpen decryption process is invoked. [Not Support in Server] |
[options.fileOpen.encryptKey] | number[] - Decrypt an array of charcodes for the key |
[options.fileOpen.cipher] | string[] - The cipher type. Default: Cipher_Type::cipherRC4 , Please refer to values starting from Cipher_Type::cipherRC4 and this should be one of these values except Cipher_Type.cipherNone |
|
inline |
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.
degree | number - The rotation degree value, It should be 0,90,180, 270, or any angle value that is a multiple of 90 degrees. |
[options] | object - Rotated center point information (added in version 9.0.0), including page index and device coordinates relative to the top-left corner of the page. The default is the top left corner of the current page |
options.pageIndex | number - The index of the page where the rotation center point is located. After rotation, It will be displayed as the current page. |
options.offsetX | number - The X-axis offset in the upper-left corner of the page. If you need to use PDF coordinates, you can use this API(PDFPageRender.transformPoint) for conversion. |
options.offsetY | number - The Y-axis offset in the upper-left corner of the page. This coordinate is relative to the top left corner of the page. If you need to use PDF coordinates, you can use this API(PDFPageRender.transformPoint) for conversion. |
|
inline |
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.
ActionCallbackClass | new(app:any)=>ActionCallback - A customized ActionCallback class. null/undefined means not use any action callback. Users can implement only part of the callbacks according to actual requirements. The custom ActionCallback class will be instantiated internally and will receive an app object for easy invocation of the internal implementation. |
|
inline |
Provide API to set Automatically Calculate Field Values.
autoCalculate | boolean - Specifies whether to set automatically calculate field values. |
|
inline |
Set the default configured callback function for the annotation.See PDFPage::addAnnot for the return object format.
fn | (type:string,intent:string)=>object - The default configured callback function. function example (pdfViewer) { pdfViewer.setDefaultAnnotConfig(function(type,intent){ let config={}; config.borderInfo = {}; config.defaultAppearance = {}; switch (type) { case "underline": config.color=0xff0000; break; case "squiggly": config.color=0xff0000; break; default: config.calloutLineEndingStyle = 2;//Circle config.startStyle = 1;//square config.endStyle = 1;//square config.fillColor = 0xffff00; config.title = 'title'; break; } return config; }); } |
|
inline |
Configures printing parameters.
[printSetting={}] | object - Specifies print setting. |
[printSetting.showHeaderFooter=false] | boolean - Sets whether to print the current document with the Header&Footer or not. False means to print without Header&Footer, otherwise is true. This option is only available on Chrome, FireFox and Chromium Edge. |
[printSetting.quality=100] | number - Specifies the printing quality percentage. Valid range: 100 ~ 1000. |
|
inline |
Sets the background and foreground colors for viewing documents. [Not support in Server]
colors | object - The object includes the background and foreground. |
|
inline |
Set whether JavaScript is allowed or not.
enable | boolean - True allows JavaScript to execute, and false does the opposite |
|
inline |
Set whether the 3D module is enabled to be loaded.
enable | boolean - True to enable to load the 3D module. False to disable to load the 3D module. |
|
inline |
Set whether shortcut key is enabled or disabled.
enable | boolean - True to enable shortcut key. False to disable shortcut key. |
|
inline |
Sets the width of the eraser.
width | number - The width of the eraser. |
|
inline |
Set dynamic information of stamps. [Not support in Server]
sperator | string - Seperator character between user name and time. |
timeFormat | string - Time format same as parameter of Date.Format. |
|
inline |
Sets whether to keep the current form field to be created continuously.
isContinuous | boolean - Specifies whether to keep the current form field. True to stick to the current form field. False to exit the current form field. function example (pdfViewer) { pdfViewer.setFormCreationContinuously(false); } |
|
inline |
Set whether form field focus rectangle is visible or not.
isVisible | boolean - Specifies whether to show form field focus rectangle. |
|
inline |
Set form highlight color. [Not support in Server]
color | number - Specify highlight color. Format: 0xAARRGGBB. |
[requiredColor] | number - Specify highlight color for the required field. Format: 0xAARRGGBB. |
|
inline |
Set ink signature list.
inkSignList | object[] - An array of ink signature. |
|
inline |
Set JR custom font. [Not support in Server]
fontMaps | FontMap[] - Custom fonts. The Settings are valid before opening the document. |
|
inline |
Sets the timeout for the pencil drawing. A new pencil is created beyond the timeout period.
millseconds | number - The timeout period, millseconds. |
|
inline |
Set the snap mode that will be used to calculate the point position.
stateHandlerName | string - State handler name which supports snap mode:
|
mode | SNAP_MODE - PDFViewCtrl.constants.SNAP_MODE[] |
|
inline |
Set the global username.
userName | string - Set the global username that will be used for the annotation title |
|
inline |
Capture the picture of the specified area on the page.
pageIndex | number - index of the page |
left | number - The X-axis offset in the upper-left corner of the page in device pixels. |
top | number - The Y-axis offset in the upper-left corner of the page in device pixels. |
width | number - Area width in device pixels. |
height | number - Area width in device pixels. |
|
inline |
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.
blob | Blob - image data |
|
inline |
Scale the page with the point of the fixedPosition as the center.
scale | number - The scaling ratio, which must be within the minScale and maxScale ranges specified in the PDFViewer.constructor parameters. |
fixedPosition | object - The point where the fixed point is located, relative to upper left of the viewport. |
[fixedPosition.pageIndex] | number - The page index is where the fixed point is located. The pageIndex and fixedPosition will be ignored if the fixedPosition point is out of the PDF Page boundary. |
fixedPosition.x | number - The x-axis coordinate value, that is relative to left-corner of the browser viewport |
fixedPosition.y | number - The y-axis coordinate value, that is relative to upper-corner of the browser viewport |
|
inline |
Zoom to the given scale.
scale | number|'fitWidth'|'fitHeight' - The values must be within the minScale and maxScale ranges specified in the PDFViewer.constructor parameters. If it's a string, only 'fitWidth' and 'fitHeight' are valid. The value 'fitHeight' is consistent with the function 'Fit Page'. |
[position] | object - A position that is the center point for zoom. |
position.pageIndex | number - Page index of target page. |
position.x | number - The x-axis of target position in PDF coordinate system. |
position.y | number - The y-axis of target position in PDF coordinate system. |
HTMLElement element |
A DOM element used to render the stuffs generated in PDFViewer. This element is the DOM node passed by PDFViewer.init
method.
typeof i18next PDFViewer::i18n |