How to upgrade from WebViewer 6.x to 8.x?

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 documentViewer and annotationManager which are now available from instance.Core.

Migration guides:

  • Version 8.0 (namespace changes) PDFTron
  • Version 7.0 (page index change from 0 to 1) PDFTron
1 Like

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

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

Thank you!

It looks like you are placing lib assets in a different location than WebViewer itself.

Where is your core and ui are located? Is it React/Angular/Vue app?

1 Like

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.

Hello DanteDee,

Are you using AWS or what is your deployment method? This sounds like a cors issue.

Best Regards,

Ahmad Moaaz
Software Developer
PDFTron Systems, Inc.
www.pdftron.com

1 Like

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.