This video should walk you through how to upgrade from earlier versions of WebViewer, before the npm package was available: How to upgrade PDFTron's WebViewer from version 6.x to 8.x - YouTube.
Few things to watch out for, version 7 made all page APIs 1-indexed, and version 8 made changes to
annotationManager which are now available from
- Version 8.0 (namespace changes) PDFTron
- Version 7.0 (page index change from 0 to 1) PDFTron
Hello, I’m Ron, an automated tech support bot
While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:
Great tutorial! Thank you! I unfortunately keep getting this error,
webviewer.min.js:1 Viewer is on a different domain, the promise from WebViewer function is rejected and API functions will not work because of cross domain permissions.
I am updating from 7.x to 8.x
It looks like you are placing lib assets in a different location than WebViewer itself.
Where is your
ui are located? Is it React/Angular/Vue app?
The webviewer is being created under a “Scripts” folder. The lib assets are in a lib folder. Both are folders live at the root of the project.
Are you using AWS or what is your deployment method? This sounds like a cors issue.
PDFTron Systems, Inc.
I believe this is an AWS yes. Ever since updating to the new version and following the steps, I have been experiencing this issue.
The lib folder needs to be served as a static asset. For example in React app, it is the public folder. If you still need to proceed hosting them elsewhere, you can refer to this guide: PDFTron.