- PdfViewer
- Parameters
- Examples
- zoomMode
- scrollMode
- spreadMode
- sidebarView
- cursorTool
- rotationMode
- pagesCount
- page
- pagesRotation
- pageRotation
- fileName
- theme
- language
- license
- element
- productInfo
- render
- show
- hide
- destroy
- open
- close
- save
- saveAsBinary
- saveAsBlob
- downloadOriginal
- rotateCurrentPage
- rotateAllPages
- rotatePages
- toggleFullScreen
- PdfJs
Extends EventTarget
The viewer component to display PDF files. Renders PDF.js viewer in an iframe but updates UI theme and structure for a neat and fast experience.
-
optionsObject The options for PdfViewer class.-
options.idString The id that will be used for DOM element of this component in the page. If the id is already used, it will be incremented likepdfViewer2...pdfViewerX. (optional, default"pdfViewer") -
options.hiddenBoolean A value indicating whether the component is displayed when page is loaded. When set to false, the component can be displayed later via calling PdfViewer#show method. For example, the component can be displayed via a button's click event. (optional, defaultfalse) -
options.width(Number | String) The width of the component. If it's a number it will be treated as pixels, if it's a string it will be treated as CSS units (e.g."80%","36rem"). (optional, default960) -
options.height(Number | String) The height of the component. If it's a number it will be treated as pixels, if it's a string it will be treated as CSS units (e.g."80%","36rem"). (optional, default720) -
options.borderBoolean A value indicating whether the component should haver borders. (optional, defaulttrue) -
options.resizableBoolean A value that specifies if the component can be resized when the user drags sides. (optional, defaulttrue) -
options.libraryPathString The path from where the component should load its assets (css, images etc.). Relative paths will be considered relative to the host page. If not set, script version (.js) will try to use same directory of the script, module version (.mjs) will use"pdfjskit". (optional, default"pdfjskit") -
options.languageString The display (user interface) language of the component. It can be set to the two-letter language names like"en","de","fr"etc. or to specific languages like"en-US","de-DE","fr-FR"etc. (optional, defaultnavigator.language||"en-US") -
options.licenseObject The license info (JSON) you received when you purchased. The evaluation version is the same as the purchased one – the trial version simply becomes licensed when you apply the license. If not set, you will see license reminder every time you load a document. { license: { "key": "42U44-A8W3U-0TG5A-66C4F-3AA0E-776A0", "owner": "*.example.com", "date": "2024-09-01", "product": "PdfJSKit", "type": "Professional", "version": "1.0" } } (optional, defaultnull) -
options.documentUrl(String | URL) The url of the PDF to open on load. Relative paths will be considered relative to the host page. (optional, default"") -
options.documentData(PdfJs#TypedArray | ArrayBuffer | Array<number> | string) The binary data of the PDF to open on load. If binary data is provided, then it will be used first instead ofdocumentUrl.Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is BASE64-encoded, useatob()to convert it to a binary string first.NOTE: If TypedArrays are used they will generally be transferred to the worker-thread. This will help reduce main-thread memory usage, however it will take ownership of the TypedArrays. (optional, defaultnull) -
options.documentPasswordString The password of the PDF to open on load, for decrypting password-protected PDFs. (optional, defaultnull) -
options.documentSizeNumber The file size of the PDF to open on load, if known. It's used for progress reports and range requests operations. (optional, defaultnull) -
options.zoomMode(String | Number) The initial mode for zooming pages in the viewer. Possible values are"auto","page-actual","page-width","page-height","page-fit"(case insensitive and dashes can be omitted) or a percentage string like"80%"or a percentage number like80. If not set, the document's zoom level will be remembered per document via browser's local storage. The history will start with"auto". (optional, default"") -
options.scrollModeString The initial mode for scrolling pages in the viewer. Possible values are"vertical","horizontal","wrapped","page"(case insensitive). If not set, the document's scroll mode will be remembered per document via browser's local storage. The history will start with"vertical".
Note that ifrememberViewHistoryis set tofalse, then it can be derived from 'PageLayout' setting inside PDF if exists. (optional, default"unknown") -
options.spreadModeString The initial mode for spreading pages in the viewer. Possible values are"none","odd","even"(case insensitive). If not set, the document's spread mode will be remembered per document via browser's local storage. The history will start with"none". Note that ifrememberViewHistoryis set tofalse, then it can be derived from 'PageLayout' setting inside PDF if exists. (optional, default"unknown") -
options.sidebarViewString The initial active view in sidebar of the viewer. Possible values are"none","thumbs","outline","attachments","layers"(case insensitive). If not set, the sidebar view will be remembered per document via browser's local storage. The history will start with"none". Note that ifrememberViewHistoryis set tofalse, then it can be derived from 'PageMode' setting inside PDF if exists. (optional, default"unknown") -
options.cursorToolString The initial cursor tool in the viewer. Possible values are"select","hand"(case insensitive). (optional, default"select") -
options.rotationModeString A value that specifies whether rotate buttons should only rotate all pages or only the currently viewed page. Possible values are"all-pages","current-page"(case insensitive and dashes can be omitted). (optional, default"all-pages") -
options.rememberViewHistoryBoolean A value that specifies whether for each document fingerprint, the viewer should remember UI state via browser's local storage, i.e. last viewed page, zoom level, scroll position, rotation,sidebarView,scrollMode,spreadMode. If you want the viewer to discard any view history entries and always load all documents at the first page (and with default zoom values), then you should set this property tofalse. (optional, defaulttrue) -
options.toolbarVisibleBoolean A value that specifies whether the top toolbar is visible. (optional, defaulttrue) -
options.sidebarVisibleBoolean A value that specifies whether the left sidebar is visible. (optional, defaulttrue) -
options.verticalToolbarVisibleBoolean A value that specifies whether the right vertical toolbar is visible. (optional, defaulttrue) -
options.toolbarAtBottomBoolean A value that specifies whether the top toolbar should be placed at the bottom instead. (optional, defaultfalse) -
options.themeString The theme to use for the viewer. Possible values are"slate","classic-light","classic-dark"or the CSS class name of a custom theme. When two values separated by comma is set, the second value will be the dark theme. Dark theme is used when a user indicates their preference through an operating system setting (e.g. light or dark mode) or a user agent setting. When single value is provided, dark theme is disabled, i.e. the only provided theme will be used always even when user prefers dark mode. (optional, default"slate, classic-dark") -
options.mobileModeString A value that specifies on which mobile device type to use large UI sizing for the viewer. Possible values are"on-any","on-phone","on-tablet","never"(case insensitive and dashes can be omitted). Note that device features are not detected, instead browser's viewport size is used to decide the UI sizing. So if you manually resize the browser window (or emulate a device via browser's F12 dev tools), phone or tablet size can be triggered. (optional, default"on-any") -
options.debugModeBoolean A value indicating whether to show details in text box in the addition to the main message on error dialog. This can be useful for debugging purpose. (optional, defaultfalse) -
options.eventsObject? The event handlers to register. An event handler can be a function or name of the function in string. String function name should refer to a valid JavaScript function which is accessible on the host page. String Function names should be specified without parentheses like "FunctionName" or "Namespace.FunctionName". events: { loaded: showEvent, failed: "functionNameInHostPage" }function showEvent(e) { var json = JSON.stringify(e.detail, null, 2); //console.log(e.target); //console.log(e.type); console.log(json); }options.events.loaded(Function | String) The event raised when the viewer has been loaded. //SAMPLE OUTPUT: { "eventName": "loaded" } (optional, defaultnull)options.events.failed(Function | String) The event raised when an error occurs. //SAMPLE OUTPUT: { "eventName": "failed", "document": "document.pdf", "message": "Invalid or corrupted PDF file.", "reason": "Invalid PDF structure.", "isResponseError": false } (optional, defaultnull)options.events.documentLoaded(Function | String) The event raised when a document has been loaded. //SAMPLE OUTPUT: { "eventName": "documentLoaded", "document": "document.pdf" } (optional, defaultnull)options.events.pageChanged(Function | String) The event raised when viewed page is changed. //SAMPLE OUTPUT: { "eventName": "pageChanged", "document": "document.pdf", "pageNumber": 2, "pageLabel": null, "previous": 1 } (optional, defaultnull)options.events.pageRendered(Function | String) The event raised when a page had finished rendering. //SAMPLE OUTPUT: { "eventName": "pageRendered", "document": "document.pdf", "pageNumber": 1, "cssTransform": false, "timestamp": 1426.5, "error": null } (optional, defaultnull)options.events.rotationChanged(Function | String) The event raised when page rotation is changed. //SAMPLE OUTPUT: { "eventName": "rotationChanged", "document": "document.pdf", "pagesRotation": 90, "pageNumber": 2, "pageRotation": 90 } (optional, defaultnull)options.events.downloading(Function | String) The event raised before user downloads the original document or PDF version. //SAMPLE OUTPUT: { "eventName": "downloading", "document": "document.pdf", "isFromKeyboard": false, "downloadType": "pdf" } (optional, defaultnull)options.events.printing(Function | String) The event raised before user prints the document. //SAMPLE OUTPUT: { "eventName": "printing", "document": "document.pdf", "totalPages": 91 } (optional, defaultnull)options.events.printed(Function | String) The event raised when printing is completed. //SAMPLE OUTPUT: { "eventName": "printed", "document": "document.pdf", "totalPages": 91 } (optional, defaultnull)options.events.textSelected(Function | String) The event raised when user selects text in the document. //SAMPLE OUTPUT: { "eventName": "textSelected", "document": "document.pdf", "text": "We are intently focused on implementing new and innovative strategies " } (optional, defaultnull)options.events.textCopied(Function | String) The event raised when user copies the selected text in the document. //SAMPLE OUTPUT: { "eventName": "textCopied", "document": "document.pdf", "text": "We are grateful for the recent enactment of the substantial multi-year funding" } (optional, defaultnull)
-
options.permissionsObject? The permissions for the viewer to enable/disable corresponding UI elements.options.permissions.viewThumbnailsBoolean Ability to view thumbnails for the document pages. (optional, defaulttrue)options.permissions.viewOutlinesBoolean Ability to view outlines of the document. (optional, defaulttrue)options.permissions.viewAttachmentsBoolean Ability to view attachments of the document. (optional, defaulttrue)options.permissions.viewLayersBoolean Ability to view layers of the document. (optional, defaulttrue)options.permissions.navigatePagesBoolean Ability to navigate pages, e.g. next page, previous page and jump to page. (optional, defaulttrue)options.permissions.zoomBoolean Ability to zoom in or out of the document. (optional, defaulttrue)options.permissions.changeZoomModeBoolean Ability to change zoom mode of the document, e.g. fit width, fit page etc. (optional, defaulttrue)options.permissions.findBoolean Ability to find text within the document. (optional, defaulttrue)options.permissions.downloadOriginalBoolean Ability to download the original document. Downloading can be disabled for security (DRM) purpose. (optional, defaultfalse)options.permissions.saveBoolean Ability to save the document, if there are changes like new annotations, these will be included. Saving can be disabled for additional security (DRM) purpose. (optional, defaulttrue)options.permissions.printBoolean Ability to print the displayed document. Printing can be disabled for additional security (DRM) purpose. (optional, defaulttrue)options.permissions.openBoolean Ability to open local PDF files, i.e. user is shown "Open" menu item which is when clicked shows browser's open dialog to choose a PDF file to load. (optional, defaulttrue)options.permissions.goFullScreenBoolean Ability to switch the viewer to full screen. (optional, defaulttrue)options.permissions.goPresentationModeBoolean Ability to switch the viewer to presentation mode. (optional, defaulttrue)options.permissions.viewPropertiesBoolean Ability to view properties of the document. (optional, defaulttrue)options.permissions.selectTextBoolean Ability to select and copy text in the displayed document Text selection can be disabled for additional security (DRM) purpose. (optional, defaulttrue)options.permissions.panBoolean Ability to pan the document. (optional, defaulttrue)options.permissions.rotateBoolean Ability to rotate the page or document, e.g. rotate clockwise and rotate counterclockwise. (optional, defaulttrue)options.permissions.changeScrollModeBoolean Ability to change scroll mode of the document, e.g. vertical, horizontal etc. (optional, defaulttrue)options.permissions.changeSpreadModeBoolean Ability to change spread mode of the document, e.g. odd, even etc. (optional, defaulttrue)options.permissions.viewAnnotationsBoolean Ability to view annotations of the document. Note that this can also effect displaying of the signatures in the document so be aware when you disable it. (optional, defaulttrue)options.permissions.editAnnotationsBoolean Ability to edit annotations of the document. Tools like Add Signature, Highlight, Draw, Add Image will be available. If no ViewAnnotations permission, then you can add new annotations but not view and edit existing ones. (optional, defaulttrue)options.permissions.fillFormsBoolean Ability to fill values into form fields of the document. Requires also ViewAnnotations permission. (optional, defaulttrue)options.permissions.editCommentsBoolean Ability to edit comments of the document. (optional, defaulttrue)options.permissions.runScriptsBoolean Ability to allow execution of active content (JavaScript) by PDF files. (optional, defaulttrue)
-
options.searchOptionsObject? The text search options of the viewer.If you specify a search term, an automatic search will be done when the document is displayed, i.e. the specified term will be searched and the term(s) will be highlighted in the pages. For example, if you launch the viewer from a search results page, you can pass the same search term to the viewer.options.searchOptions.termString A value that specifies the search term used.Refer tooptions.searchOptions.matchAnyWordto see how to specify multiple phrases inside a query. (optional, default"")options.searchOptions.matchCaseBoolean The search should be case-sensitive, i.e. the found text must match the case of the search term. (optional, defaultfalse)options.searchOptions.matchDiacriticsBoolean The search should match the letters with diacritics (accents), e.gumatches alsoü. Diacritics, often loosely calledaccents, are the various little dots and squiggles which, in many languages, are written above, below or on top of certain letters of the alphabet to indicate something about their pronunciation. (optional, defaultfalse)options.searchOptions.matchWholeWordBoolean The search should match the whole word only, i.e the found text must be a whole word (surrounded by a non-word character). (e.g. "doc" matches " doc " or ".doc" but not "document"). (optional, defaultfalse)options.searchOptions.matchAnyWordBoolean The search should match the term as a whole or match any word in the term separately.For example;*bicycle bellswill matchbicycleorbellsorbicycle bellsred "four wheels" petrolwill matchredorfour wheelsorpetrolorred four wheels petrolred ""four wheels"" petrolwill matchredor"four wheels"orpetrolorred "four wheels" petrolThe quotation marks can be used to specify phrases inside a query. Note that two consecutive quotation marks""can be used to escape, i.e. to search for a quotation mark literally as". (optional, defaultfalse)
options.searchOptions.highlightColorString The color to use for highlighting search results. Default is yellow. (optional, default"#FFFF00")options.searchOptions.activeHighlightColorString The color to use for highlighting active (current) search result. Default is orange. (optional, default"#FFA500")options.searchOptions.highlightAllBoolean A value that specifies whether to highlight all search results, i.e. not only active (current) search result. (optional, defaulttrue)
-
options.printOptionsObject? The print options of the viewer.options.printOptions.resolutionNumber A value in percentage that specifies the resolution (quality level) used when printing. The default level ensures excellent quality but may cause slow printing for some documents, you can decrease the level to increase the printing speed while maintaining an acceptable quality for your case. (optional, default150)options.printOptions.autoRotateBoolean A value that specifies whether to enable automatic rotation of landscape pages upon printing. Note that most browsers may already auto-rotate pages when printing. (optional, defaulttrue)
-
options.translationsObject? A value that specifies the custom translations for the viewer. The viewer has about 111 language files, however for some few custom text which are not inside those language files, this property is used to override. For example, you can override the default "Rotation Mode" message for localization purpose. translations: { "en": { "preparing-document": "Preparing document...", "cover-sheet": "Cover Sheet", "rotation-mode": "Rotation Mode", "rotation-mode-title": "Rotation Mode (rotate current page or all pages)", "full-screen": "Full Screen", "download-original": "Download Original", "any-word": "Any Word" }, "de": { "any-word": "Jedes Wort" } }
-
import PdfViewer from "pdfjskit";
var pdfViewer = new PdfViewer({
documentUrl: "pdfjskit/sample.pdf",
width: "80%",
height: 720,
resizable: true,
language: "en-US",
theme: "slate, classic-dark"
});
pdfViewer.render(document.getElementById("container"));Gets or sets the mode for zooming pages in the viewer.
Possible values are "auto", "page-actual", "page-width", "page-height", "page-fit" (case insensitive and dashes can be omitted) or a percentage string like "80%" or a percentage number like 80.
Gets or sets the mode for scrolling pages in the viewer.
Possible values are "vertical", "horizontal", "wrapped", "page" (case insensitive).
Type: String
Gets or sets the mode for spreading pages in the viewer.
Possible values are "none", "odd", "even" (case insensitive).
Type: String
Gets or sets the active view in sidebar of the viewer.
Possible values are "none", "thumbs", "outline", "attachments", "layers" (case insensitive).
Type: String
Gets or sets the cursor tool in the viewer.
Possible values are "select", "hand" (case insensitive).
Type: String
Gets or sets a value that specifies whether rotate buttons should only rotate all pages or only the currently viewed page.
Possible values are "all-pages", "current-page" (case insensitive and dashes can be omitted).
Type: String
Gets the page count of the document.
Type: Number
Gets or sets the current page of the document.
Type: Number
Gets or sets the rotation degree for all pages.
Type: Number
Gets or sets the rotation degree for current page only.
Type: Number
Gets the file name of current document.
Type: String
Gets or sets the theme to use for the viewer.
Possible values are "slate", "classic-light", "classic-dark" or the CSS class name of a custom theme.
When two values separated by comma is set, the second value will be the dark theme.
Dark theme is used when a user indicates their preference through an operating system setting (e.g. light or dark mode) or a user agent setting.
When single value is provided, dark theme is disabled, i.e. the only provided theme will be used always even when user prefers dark mode.
Type: String
Gets or sets the display (user interface) language of the component.
It can be set to the two-letter language names like "en", "de", "fr" etc. or to specific languages like "en-US", "de-DE", "fr-FR" etc.
Type: String
Sets the license info (JSON) you received when you purchased. The evaluation version is the same as the purchased one – the trial version simply becomes licensed when you apply the license. If not set, you will see license reminder every time you load a document.
Type: Object
value
Gets the DOM element of this component in the page (if it's rendered).
Type: Element
Gets the product info for this component (e.g. product name and version).
Type: Object
Renders the component in the page.
targetElement? The target DOM element, e.g. the container or adjacent element. If omitted, a HTML string will be returned. Note that it's expected that user later adds this HTML string to the same window as the caller, not to other frames, otherwise we cannot track iframe loading events, and component would not work.positionString A string representing the position relative to the targetElement* 'beforebegin': Before the targetElement itself.- 'afterbegin': Just inside the targetElement, before its first child.
- 'beforeend': Just inside the targetElement, after its last child.
- 'afterend': After the targetElement itself. (optional, default
"beforeend")
Returns (Element | String) DOM element, if target was specified, otherwise HTML string.
Shows the component. Note that the component should be rendered beforehand.
Hides the component. Note that the component should be rendered beforehand.
Destroys the component. Removes the component element from DOM.
Opens a new document.
argsObject Accepts any/all of the properties from PdfJs#DocumentInitParameters, and also aoriginalUrlstring.attachmentTreeNodeObject? Used internally when opening attachment tree nodes.
Returns Promise Promise that is resolved when the document is opened.
Closes current document.
Saves current document. Browser's save dialog will be launched.
Saves current document as binary (byte array).
discardEditsBoolean A value that specifies whether to discard edits e.g. if there are changes like new annotations.
Returns Uint8Array
Saves current document as blob.
discardEditsBoolean A value that specifies whether to discard edits e.g. if there are changes like new annotations.
Returns Blob
Downloads the original of current document. Browser's save dialog will be launched.
Rotates current page by delta degree.
deltaNumber The degree to add to the rotation.
Rotates all pages by delta degree.
deltaNumber The degree to add to the rotation.
Rotates all pages or current page according to current rotation mode, by delta degree.
deltaNumber The degree to add to the rotation.
Toggles full screen mode.
PDF.js related type definitions.
Type: (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)
Document initialization / loading parameters object.
Type: Object
url(string | URL)? The URL of the PDF.data(PdfJs#TypedArray | ArrayBuffer | Array<number> | string)? Binary PDF data. Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is BASE64-encoded, useatob()to convert it to a binary string first.NOTE: If TypedArrays are used they will generally be transferred to the worker-thread. This will help reduce main-thread memory usage, however it will take ownership of the TypedArrays.httpHeadersObject? Basic authentication headers.withCredentialsboolean? Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers. The default isfalse.passwordstring? For decrypting password-protected PDFs.lengthnumber? The PDF file length. It's used for progress reports and range requests operations.rangePDFDataRangeTransport? Allows for using a custom range transport implementation.rangeChunkSizenumber? Specify maximum number of bytes fetched per range request. The default value is DEFAULT_RANGE_CHUNK_SIZE.workerPDFWorker? The worker that will be used for loading and parsing the PDF data.verbositynumber? Controls the logging level; the constants from VerbosityLevel should be used.docBaseUrlstring? The base URL of the document, used when attempting to recover valid absolute URLs for annotations, and outline items, that (incorrectly) only specify relative URLs.cMapUrlstring? The URL where the predefined Adobe CMaps are located. Include the trailing slash.cMapPackedboolean? Specifies if the Adobe CMaps are binary packed or not. The default value istrue.CMapReaderFactoryObject? The factory that will be used when reading built-in CMap files. Providing a custom factory is useful for environments without Fetch API orXMLHttpRequestsupport, such as Node.js. The default value is {DOMCMapReaderFactory}.useSystemFontsboolean? Whentrue, fonts that aren't embedded in the PDF document will fallback to a system font. The default value istruein web environments andfalsein Node.js; unlessdisableFontFace === truein which case this defaults tofalseregardless of the environment (to prevent completely broken fonts).standardFontDataUrlstring? The URL where the standard font files are located. Include the trailing slash.StandardFontDataFactoryObject? The factory that will be used when reading the standard font files. Providing a custom factory is useful for environments without Fetch API orXMLHttpRequestsupport, such as Node.js. The default value is {DOMStandardFontDataFactory}.useWorkerFetchboolean? Enable using the Fetch API in the worker-thread when reading CMap and standard font files. Whentrue, theCMapReaderFactoryandStandardFontDataFactoryoptions are ignored. The default value istruein web environments andfalsein Node.js.stopAtErrorsboolean? Reject certain promises, e.g.getOperatorList,getTextContent, andRenderTask, when the associated PDF data cannot be successfully parsed, instead of attempting to recover whatever possible of the data. The default value isfalse.maxImageSizenumber? The maximum allowed image size in total pixels, i.e. width * height. Images above this value will not be rendered. Use -1 for no limit, which is also the default value.isEvalSupportedboolean? Determines if we can evaluate strings as JavaScript. Primarily used to improve performance of PDF functions. The default value istrue.isOffscreenCanvasSupportedboolean? Determines if we can useOffscreenCanvasin the worker. Primarily used to improve performance of image conversion/rendering. The default value istruein web environments andfalsein Node.js.canvasMaxAreaInBytesnumber? The integer value is used to know when an image must be resized (usesOffscreenCanvasin the worker). If it's -1 then a possibly slow algorithm is used to guess the max value.disableFontFaceboolean? By default fonts are converted to OpenType fonts and loaded via the Font Loading API or@font-facerules. If disabled, fonts will be rendered using a built-in font renderer that constructs the glyphs with primitive path commands. The default value isfalsein web environments andtruein Node.js.fontExtraPropertiesboolean? Include additional properties, which are unused during rendering of PDF documents, when exporting the parsed font data from the worker-thread. This may be useful for debugging purposes (and backwards compatibility), but note that it will lead to increased memory usage. The default value isfalse.enableXfaboolean? Render Xfa forms if any. The default value isfalse.ownerDocumentDocument? Specify an explicit document context to create elements with and to load resources, such as fonts, into. Defaults to the current document.disableRangeboolean? Disable range request loading of PDF files. When enabled, and if the server supports partial content requests, then the PDF will be fetched in chunks. The default value isfalse.disableStreamboolean? Disable streaming of PDF file data. By default PDF.js attempts to load PDF files in chunks. The default value isfalse.disableAutoFetchboolean? Disable pre-fetching of PDF file data. When range requests are enabled PDF.js will automatically keep fetching more data even if it isn't needed to display the current page. The default value isfalse.NOTE: It is also necessary to disable streaming, see above, in order for disabling of pre-fetching to work correctly.pdfBugboolean? Enables special hooks for debugging PDF.js (seeweb/debugger.js). The default value isfalse.CanvasFactoryObject? The factory that will be used when creating canvases. The default value is {DOMCanvasFactory}.FilterFactoryObject? The factory that will be used to create SVG filters when rendering some images on the main canvas. The default value is {DOMFilterFactory}.enableHWAboolean? Enables hardware acceleration for rendering. The default value isfalse.