pdftron/webviewer is installed
"dependencies": { "@pdftron/webviewer": "^7.3.0", "body-parser": "^1.19.0", "express": "^4.17.1", "mongoose": "^5.9.7", "nodemon": "^2.0.2", "pug": "^2.0.4" }
Webviewer static files have been copied to the public folder
JavaScript in index.html file attempts to load a pdf
Welcome to webviewer import WebViewer from ‘@/webviewer’WebViewer({ path: '/webviewer', initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf' }, document.getElementById('viewer')).then(instance => {}) </script>
pdf file does not display, what is wrong with the code?
Advertisement
Answer
Thank-you for sharing a link to your repository.
From following this guide: https://www.pdftron.com/documentation/web/get-started/manually/
Please try doing the following:
Please copy and paste webviewer.min.js from the pdftron webviewer node module to /public/webviewer
in your custom.js, please remove the line that imports from webviewer
in your index.html, please add this script tag before that calls your custom.js file:
<script src='./webviewer/webviewer.min.js'></script>
Edit: I noticed that there is a 404 on the network tab when I load up your application which led me to think that the set up of the library was not integrated correctly.