I would like to put up a view to a PDF file, but I haven’t figured out how to require all the components.
Here’s amy attempt:
I started by trying to follow this JSFiddle example, Which calls in
pdf.js is not npm, so I have to find a work-around to requiring.
pdfjs = require('https://mozilla.github.io/pdf.js/build/pdf.js').catch(() => window.pdfjs)
… appears to work, but the JSFiddle example returns
Error: No "GlobalWorkerOptions.workerSrc" specified.
pdf-dist.js is on npm, and can be required:
… But using this doesn’t make the error go away.
PDFJSWorker = require('https://mozilla.github.io/pdf.js/build/pdf.worker.js').catch(() => window.PDFJSWorker)
but no dice.
[sorry for the many edits; I accidentally hit ‘submit’ early in drafting this question…]