0
  1. 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"
     }
    
  2. Webviewer static files have been copied to the public folder

  3. 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>
    
  4. pdf file does not display, what is wrong with the code?

Saud
  • 859
  • 1
  • 9
  • 23
  • Hi. Would it be possible to show screenshot of your console and network tab? Would it also be possible to provide a link to your repository? – Ryan Mar 02 '21 at 17:29
  • Here is the [repository] (https://github.com/ashe-senkatuuka/pdf-display) @Ryan – Ashe Mukisa Mar 03 '21 at 14:31

1 Answers1

2

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:

  1. Please copy and paste webviewer.min.js from the pdftron webviewer node module to /public/webviewer

  2. in your custom.js, please remove the line that imports from webviewer

  3. 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.

A Chen
  • 56
  • 3