|
FoxitPDFSDKforWeb
7.1.1
Foxit PDF SDK for Web
|
Public Member Functions | |
| 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... | |
| 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... | |
| getAllComponentsByName (name) | |
| Get all components which name is the specific string. More... | |
| getComponentByName (name) | |
| Get the first component which name is the specific string. More... | |
| getPDFViewer () | |
| Get the PDFViewer instance asynchrounously. 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: More... | |
| loading (coverOn=document.body, text='', animation=true) | |
| Overlays a loading modal layer on a specified element. 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... | |
Public Member Functions inherited from PDFViewer | |
| close (before=this.customs.closeDocBefore, after=this.customs.closeDocAfter) | |
| Close the open document. More... | |
| constructor ({ preloadJR=true, preloadSR=false, libPath, jr, i18n, i18nOptions, eventEmitter=new EventEmitter(), minScale=0.1, maxScale=10, defaultScale='fitWidth', preloadedPages=1, scaleFrequency=4, tileSize=3600, StateHandlers=[], customs={}, keymap={}, Viewmodes=[], enableJS, stateHandlerConfig, watermarkConfig, actionOptions={}, defaultViewMode=continuousViewModeName, snapshotServer=new SnapshotServer({ uploadSnapshotAPIPath:'snapshot/upload' }), highPerformance=typeof WebAssembly==='object', }={}) | |
| Create a PDFViewer. More... | |
| createNewDoc (title="untitled.pdf", author="", pageSize={height:842, width:595}) | |
| Create a new pdf document. More... | |
| getAnnotManager () | |
| Get annotation component manager. More... | |
| getAnnotRender (pageIndex, name) | |
| GetAnnotRender PDFPageRender::getAnnotRender. More... | |
| getCurrentPDFDoc () | |
| Get current pdf doc object. More... | |
| getEnableJS () | |
| Checks if PDF js can be executed. More... | |
| getEventEmitter () | |
| Get event emitter. More... | |
| getPDFDocRender () | |
| GetPDFDocRender. More... | |
| getPDFPageRender (index) | |
| GetPDFPageRender PDFDocRender::getPDFPageRender. More... | |
| getStateHandlerManager () | |
| Get state handler manager. More... | |
| getViewModeManager () | |
| Get view mode manager. More... | |
| init (selector) | |
| Init PDFViewer. More... | |
| openPDFByFile (file, options={}, pdfEngine) | |
| Open the local document. More... | |
| openPDFByHttpRangeRequest (request, options={fileName:''}) | |
| Open either a URL document by HTTP range requests or an entire file depending on if the server enables range request or not. More... | |
| redraw (force) | |
| Redraw the page view. 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... | |
| setEnableJS (enable) | |
| Set whether JavaScript is allowed or not. More... | |
| setUserName (userName) | |
| Set the global username. More... | |
| zoomTo (scale) | |
| Zoom to the given scale. More... | |
|
inline |
Attach an event listener to PDFUI instance by type.
| type | string - the event type, all event types are defined in UIExtension::UIEvents. |
| listener | function - the event callback function |
|
inline |
Attach an event listener to PDFViewer instance by type.
| type | string - the event type, all event types defined in UIExtension::PDFViewCtrl::Events. |
| listener | function - the event callback function. |
|
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.fragments] | object[] - UI fragments array, defines serveral UI components and business logics. |
| [options.addons] | Array.<string> - uix addons paths |
| [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 templat format, you must rewrite this template otherwise many unpredicatable errors will occur. |
| [options.i18n] | object - The options for i18next(an internationalization-framework), for more details please visit https://www.i18next.com/overview/configuration-options |
| [options.customs] | object - Some customize options |
| [options.customs.defaultStateHander] | PDFViewCtrl.STATE_HANDLER_NAMES - default state handler name |
| [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.5, 0.75, 1, 1.25, 1.5, 2, 4, 6], that has been used in marquee, loupe and zoom dropdown button in toolbar. |
| [options.templateParser] | TemplateParser - custom template parser, by default is XMLTtemplateParser, if your custom template format is not compatible with the internal format, you need to overwrite defaultFragments and template option, otherwise many unpredictable errors will occur. |
|
inline |
Destroys a PDFUI instance. The opening document will be closed and all component DOM elements will be destroyed.
|
inline |
Get all components which name is the specific string.
| name | string - component name. |
|
inline |
Get the first component which name is the specific string.
| name | string - component name. |
|
inline |
Get the PDFViewer instance asynchrounously.
|
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 |
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. |
|
inline |
Detach event listener from PDFUI instance by type and its callback function.
| type | string - The event type which passed as the first parameter of PDFUI::addUIEventListener(). |
| listener | function - 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 - The event type which passed as the first parameter of PDFUI.addViewerEventListener(). |
| listener | function - The event callback function passed as the secondary parameter of PDFUI.addViewerEventListener(). |