Open a document by URL

Opening a document in WebViewer from URL

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.

1WebViewer({
2 ...,
3 initialDoc: 'https://myserver.com/myfile.pdf',
4}, document.getElementById('viewer')).then(instance => {
5 const { documentViewer } = instance.Core;
6 documentViewer.addEventListener('documentLoaded', () => {
7 // perform document operations
8 });
9});

If you are loading from an extensionless URL, please ensure the extension or filename options are set.

See more in loading options

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales