Frameworks
Integrations
Mendix
SharePoint
Default UI
Modular UI
AnnotationManager
Annotation Types
Customize
Version 11
Version 10
v10.12
v10.11
v10.10
v10.9
v10.8
v10.7
v10.6
v10.5
v10.4
v10.3
v10.2
v10.1
v10.0
Version 8
v8.12
v8.11
v8.10
v8.9
v8.8
v8.7
v8.6
v8.5
v8.4
v8.3
v8.2
v8.1
v8.0
Version 7
Version 6
v6.3
v6.2
v6.1
v6.0
Version 5
Version 4
Version 3
Version 2
WebViewer Server
WebViewer BIM
There are a few ways to open a document such as from a URL, a blob, the filesystem, or base64 data. Additionally, there are loading options to help WebViewer determine the type of the file being loaded.
If you have a URL for a document, you can open it by including initialDoc
as a constructor option or by using the loadDocument
API.
Use the initialDoc constructor option to provide the document when mounting WebViewer.
Use loadDocument to load documents with additional loading options after mounting WebViewer.
See more WebViewer events such as documentLoaded
to understand when to execute API operations.
WebViewer provides various options to load a document. Whether you are loading a document through the initialDoc
option in the constructor or calling loadDocument
after mounting, you can always provide options to load your document.
When loading a document using a URL, WebViewer will use the URL to determine what type of file it is. For example http://myserver.com/myfile.docx
ends with .docx
so WebViewer will assume it's a docx file. However, what happens if you are loading from a blob or extensionless URL? That's where the extension
option comes in.
You can use the extension
option to explicitly tell WebViewer what type of file it is. For example, extension: 'docx'
or extension: 'png'
. By default WebViewer will assume it's a PDF file but that might not be correct.
Via WebViewer Constructor
Via API
The filename
option is used to indicate the name of the file when you press the download button in the viewer. However, the option can also be used as a way of indicating the type of file you are opening when the URL does not end with a file extension. Note that the extension
property has precedence over filename
for determining the document type.
Via WebViewer Constructor
Via API
If your document server requires additional options in the HTTP request, you can use the second argument in loadDocument
function to pass them. This is especially useful when you need the Authorization
header in the request with your auth key.
For password-protected documents, it can be provided during the loadDocument
call via the options argument. It can either take the password string or a function that will eventually provide a password via a callback provided as a parameter.
An Apryse custom security handler easily encrypts and secures documents with our algorithm to allow opening the document only in WebViewer (or PDFNet).
For these types of documents, it is necessary to provide the integer custom handler ID along with the password.
This is only available to WebViewer 8.2+.
If you run into any issues loading a document, please visit our FAQ.
If your document is already in Blob format you can pass the Blob object directly to loadDocument function.
See more WebViewer events such as documentLoaded
to understand when to execute API operations.
WebViewer provides various options to load a document. Whether you are loading a document through the initialDoc
option in the constructor or calling loadDocument
after mounting, you can always provide options to load your document.
When loading a document using a URL, WebViewer will use the URL to determine what type of file it is. For example http://myserver.com/myfile.docx
ends with .docx
so WebViewer will assume it's a docx file. However, what happens if you are loading from a blob or extensionless URL? That's where the extension
option comes in.
You can use the extension
option to explicitly tell WebViewer what type of file it is. For example, extension: 'docx'
or extension: 'png'
. By default WebViewer will assume it's a PDF file but that might not be correct.
Via WebViewer Constructor
Via API
The filename
option is used to indicate the name of the file when you press the download button in the viewer. However, the option can also be used as a way of indicating the type of file you are opening when the URL does not end with a file extension. Note that the extension
property has precedence over filename
for determining the document type.
Via WebViewer Constructor
Via API
If your document server requires additional options in the HTTP request, you can use the second argument in loadDocument
function to pass them. This is especially useful when you need the Authorization
header in the request with your auth key.
For password-protected documents, it can be provided during the loadDocument
call via the options argument. It can either take the password string or a function that will eventually provide a password via a callback provided as a parameter.
An Apryse custom security handler easily encrypts and secures documents with our algorithm to allow opening the document only in WebViewer (or PDFNet).
For these types of documents, it is necessary to provide the integer custom handler ID along with the password.
This is only available to WebViewer 8.2+.
If you run into any issues loading a document, please visit our FAQ.
If your document is already in ArrayBuffer format you can convert the ArrayBuffer object to a Blob and then pass resulting Blob directly to loadDocument function.
See more WebViewer events such as documentLoaded
to understand when to execute API operations.
WebViewer provides various options to load a document. Whether you are loading a document through the initialDoc
option in the constructor or calling loadDocument
after mounting, you can always provide options to load your document.
When loading a document using a URL, WebViewer will use the URL to determine what type of file it is. For example http://myserver.com/myfile.docx
ends with .docx
so WebViewer will assume it's a docx file. However, what happens if you are loading from a blob or extensionless URL? That's where the extension
option comes in.
You can use the extension
option to explicitly tell WebViewer what type of file it is. For example, extension: 'docx'
or extension: 'png'
. By default WebViewer will assume it's a PDF file but that might not be correct.
Via WebViewer Constructor
Via API
The filename
option is used to indicate the name of the file when you press the download button in the viewer. However, the option can also be used as a way of indicating the type of file you are opening when the URL does not end with a file extension. Note that the extension
property has precedence over filename
for determining the document type.
Via WebViewer Constructor
Via API
If your document server requires additional options in the HTTP request, you can use the second argument in loadDocument
function to pass them. This is especially useful when you need the Authorization
header in the request with your auth key.
For password-protected documents, it can be provided during the loadDocument
call via the options argument. It can either take the password string or a function that will eventually provide a password via a callback provided as a parameter.
An Apryse custom security handler easily encrypts and secures documents with our algorithm to allow opening the document only in WebViewer (or PDFNet).
For these types of documents, it is necessary to provide the integer custom handler ID along with the password.
This is only available to WebViewer 8.2+.
If you run into any issues loading a document, please visit our FAQ.
If you wish to allow users to open files from their local file system, you can enable this feature with:
You can enable the file picker with Features at any point in time.
You can also specify this via the WebViewer constructor at the very beginning.
And this option will be available to users in the top-right of the WebViewer UI:
If you have the File object, from a file picker for example, you can pass the object directly to the loadDocument function. File objects are similar to Blobs and should load fine.
See more WebViewer events such as documentLoaded
to understand when to execute API operations.
WebViewer provides various options to load a document. Whether you are loading a document through the initialDoc
option in the constructor or calling loadDocument
after mounting, you can always provide options to load your document.
When loading a document using a URL, WebViewer will use the URL to determine what type of file it is. For example http://myserver.com/myfile.docx
ends with .docx
so WebViewer will assume it's a docx file. However, what happens if you are loading from a blob or extensionless URL? That's where the extension
option comes in.
You can use the extension
option to explicitly tell WebViewer what type of file it is. For example, extension: 'docx'
or extension: 'png'
. By default WebViewer will assume it's a PDF file but that might not be correct.
Via WebViewer Constructor
Via API
The filename
option is used to indicate the name of the file when you press the download button in the viewer. However, the option can also be used as a way of indicating the type of file you are opening when the URL does not end with a file extension. Note that the extension
property has precedence over filename
for determining the document type.
Via WebViewer Constructor
Via API
If your document server requires additional options in the HTTP request, you can use the second argument in loadDocument
function to pass them. This is especially useful when you need the Authorization
header in the request with your auth key.
For password-protected documents, it can be provided during the loadDocument
call via the options argument. It can either take the password string or a function that will eventually provide a password via a callback provided as a parameter.
An Apryse custom security handler easily encrypts and secures documents with our algorithm to allow opening the document only in WebViewer (or PDFNet).
For these types of documents, it is necessary to provide the integer custom handler ID along with the password.
This is only available to WebViewer 8.2+.
If you run into any issues loading a document, please visit our FAQ.
If you have the file data as a base64 string, the best way to load the document in WebViewer is to first convert it to a Blob and then load it as described for Blobs. Below is some example code showing how to convert base64 to a Blob.
See more WebViewer events such as documentLoaded
to understand when to execute API operations.
WebViewer provides various options to load a document. Whether you are loading a document through the initialDoc
option in the constructor or calling loadDocument
after mounting, you can always provide options to load your document.
When loading a document using a URL, WebViewer will use the URL to determine what type of file it is. For example http://myserver.com/myfile.docx
ends with .docx
so WebViewer will assume it's a docx file. However, what happens if you are loading from a blob or extensionless URL? That's where the extension
option comes in.
You can use the extension
option to explicitly tell WebViewer what type of file it is. For example, extension: 'docx'
or extension: 'png'
. By default WebViewer will assume it's a PDF file but that might not be correct.
Via WebViewer Constructor
Via API
The filename
option is used to indicate the name of the file when you press the download button in the viewer. However, the option can also be used as a way of indicating the type of file you are opening when the URL does not end with a file extension. Note that the extension
property has precedence over filename
for determining the document type.
Via WebViewer Constructor
Via API
If your document server requires additional options in the HTTP request, you can use the second argument in loadDocument
function to pass them. This is especially useful when you need the Authorization
header in the request with your auth key.
For password-protected documents, it can be provided during the loadDocument
call via the options argument. It can either take the password string or a function that will eventually provide a password via a callback provided as a parameter.
An Apryse custom security handler easily encrypts and secures documents with our algorithm to allow opening the document only in WebViewer (or PDFNet).
For these types of documents, it is necessary to provide the integer custom handler ID along with the password.
This is only available to WebViewer 8.2+.
If you run into any issues loading a document, please visit our FAQ.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales