Class PDFTron.WebViewer.Options
Options for WebViewer on creation. Used when constructing a new PDFTron.WebViewer instance.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
a boolean indicating this user has permission to modify all annotations, even if the annotationUser and author does not match.
|
|
a user identifier for annotations.
|
|
a boolean to control creating the viewer in the constructor.
|
|
whether or not to workaround the issue of Azure not accepting range requests of a certain type.
|
|
a string to set the background color of the inner page to (desktop only)
|
|
the share ID or session ID created from PWS Cloud.
|
|
a URL path to a JavaScript configuration file that holds UI customizations.
|
|
a string of custom data that can be retrieved by the ReaderControl
|
|
an identifier for the document to be used with annotations.
|
|
the type of document the viewer will be used with.
|
|
a boolean to enable annotations.
|
|
a boolean to enable offline mode.
|
|
a boolean to enable annotations read-only mode.
|
|
an object containing encryption properties (XOD only)
|
|
a path to an HTML page to display errors.
|
|
the path to a xod document folder generated using the external parts option
|
|
whether to hide the annotation panel or not.
|
|
a PDFTron.WebViewer.Options object that overrides the existing options when the Mobile viewer is loaded.
|
|
an alternative path to the Mobile WebViewer, relative to the "path" option.
|
|
a PDFTron.WebViewer.Options object that overrides the existing options when the viewer is loaded.
|
|
an alternative path to the WebViewer, relative to the "path" option.
|
|
the URL path to a xod document to load on startup
|
|
the license key for viewing PDF files (PDF only)
|
|
a boolean indicating whether the mobile viewer should redirect to a new window or not (mobile only, default true)
|
|
an alternative path to the WebViewer root folder.
|
|
a string to control PDF engine ["auto", "ems", "pnacl"](PDF only, default "auto" chooses the best option availible)
|
|
a boolean to enable the use of PDFNet.js library functions (PDF only, default false)
|
|
a boolean to enable the preloading of the PDF worker files (PDF only, default true)
|
|
a URL to the server-side script that handles annotations.
|
|
a boolean to show/hide the local file picker (PDF only, default false)
|
|
a boolean to show/hide the page history buttons (default true)
|
|
a boolean to show/hide the default toolbar control.
|
|
whether to start loading the document in offline mode or not.
|
|
a boolean indicating whether to use http or streaming PartRetriever, it is recommended to keep streaming false for better performance.
|
|
Enable or disable using PNaCl subzero compiler.
|
|
the type of WebViewer to load.
|
|
enable or disable using Downloader on urls (PDF only, default true)
|
|
a promise that will resolve to a PDF worker, used if you already create a worker on the outer page and want to share it with the viewer (PDF only)
|
|
a URL to the proxy HTML file on the remote server when using the xdomain CORS workaround.
|
Field Detail
{boolean}
annotationAdmin
a boolean indicating this user has permission to modify all annotations, even if the annotationUser and author does not match.
{string}
annotationUser
a user identifier for annotations. All annotations created will have this as the author. It is used for permission checking: user only permitted to modify annotations where annotationUser and author matches.
{boolean}
autoCreate
a boolean to control creating the viewer in the constructor. When set to false, invoke the create() method explicity. (default true)
- Default Value:
- true
{boolean}
azureWorkaround
whether or not to workaround the issue of Azure not accepting range requests of a certain type. Enabling the workaround will add an extra HTTP request of overhead but will still allow documents to be loaded from other locations.
{string}
backgroundColor
a string to set the background color of the inner page to (desktop only)
{string}
cloudApiId
the share ID or session ID created from PWS Cloud. Note: the browser must have CORS support. (optional, ignored when initialDoc is also set)
{string}
config
a URL path to a JavaScript configuration file that holds UI customizations.
{string}
custom
a string of custom data that can be retrieved by the ReaderControl
{string}
documentId
an identifier for the document to be used with annotations. (required for full annotation support)
{string}
documentType
the type of document the viewer will be used with. Valid values are "xod" and "pdf". (default "xod")
{boolean}
enableAnnotations
a boolean to enable annotations.
- Default Value:
- false
{boolean}
enableOfflineMode
a boolean to enable offline mode.(default false)
{boolean}
enableReadOnlyMode
a boolean to enable annotations read-only mode.(default false)
{object}
encryption
an object containing encryption properties (XOD only)
{string}
errorPage
a path to an HTML page to display errors.
{string}
externalPath
the path to a xod document folder generated using the external parts option
{boolean}
hideAnnotationPanel
whether to hide the annotation panel or not.
- Default Value:
- false
{PDFTron.WebViewer.Options}
html5MobileOptions
a PDFTron.WebViewer.Options object that overrides the existing options when the Mobile viewer is loaded.
{string}
html5MobilePath
an alternative path to the Mobile WebViewer, relative to the "path" option.
- Default Value:
- "html5/MobileReaderControl.html"
{PDFTron.WebViewer.Options}
html5Options
a PDFTron.WebViewer.Options object that overrides the existing options when the viewer is loaded.
{string}
html5Path
an alternative path to the WebViewer, relative to the "path" option.
- Default Value:
- "html5/ReaderControl.html"
{string}
initialDoc
the URL path to a xod document to load on startup
{string}
l
the license key for viewing PDF files (PDF only)
{boolean}
mobileRedirect
a boolean indicating whether the mobile viewer should redirect to a new window or not (mobile only, default true)
- Default Value:
- true
{string}
path
an alternative path to the WebViewer root folder.
{string}
pdfBackend
a string to control PDF engine ["auto", "ems", "pnacl"](PDF only, default "auto" chooses the best option availible)
- Default Value:
- "auto"
{boolean}
pdfnet
a boolean to enable the use of PDFNet.js library functions (PDF only, default false)
{boolean}
preloadPDFWorker
a boolean to enable the preloading of the PDF worker files (PDF only, default true)
{string}
serverUrl
a URL to the server-side script that handles annotations. (required for full annotation support)
{boolean}
showLocalFilePicker
a boolean to show/hide the local file picker (PDF only, default false)
{boolean}
showPageHistoryButtons
a boolean to show/hide the page history buttons (default true)
{boolean}
showToolbarControl
a boolean to show/hide the default toolbar control.
{boolean}
startOffline
whether to start loading the document in offline mode or not.(default false)
{boolean}
streaming
a boolean indicating whether to use http or streaming PartRetriever, it is recommended to keep streaming false for better performance.
- Default Value:
- false
{boolean}
subzero
Enable or disable using PNaCl subzero compiler. With subzero enabled the first load and execution is significantly faster at the expense of slightly slower execution (about 10%) for subsequent usage. Note that subzero is only consistently available on Chrome 51 or above so this flag will be ignored on earlier Chrome versions. (PDF only, default true)
{string}
type
the type of WebViewer to load. Values must be comma-separated in order of preferred WebViewer. (Possibe values: html5, html5Mobile)
- Default Value:
- "html5,html5Mobile"
{boolean}
useDownloader
enable or disable using Downloader on urls (PDF only, default true)
{boolean}
workerTransportPromise
a promise that will resolve to a PDF worker, used if you already create a worker on the outer page and want to share it with the viewer (PDF only)
{string}
xdomainProxyUrl
a URL to the proxy HTML file on the remote server when using the xdomain CORS workaround. Can also be an object to specify multiple URLs.