Replies: 1 comment
-
Short answer: The library is on CDN's and the demo is not. Long answer: There are two versions of pdf.js. Well actually there is only one, but you have got the library and you have got the demo. First there is the library, which you can find here: https://mozilla.github.io/pdf.js There are many ways you can download the library, see the github page: If you download the zip file, you have got a file named pdf.js-master.zip The code of the demo (incl. library) you can download here:
If you download the demo, you will have a file which looks like this: pdfjs-4.10.38-dist.zip The library, pdf.mjs and some other files are hosted on different CDN's. Discaimer: I am not involved in the project, so I could be wrong. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to to get the
web/viewer.html
file to work properly with the suggested CDN distribution ofPDF.js
? Currently, there are four references to other files in the prebuilt versionweb/viewer.html
:I have already verified that if I change the reference of "../build/pdf.mjs" to:
then the pdf still renders properly.
But when I similarly try to change the link to the CSS file "viewer.css" to:
it no longer renders properly. Same for the
viewer.mjs
. I think this makes sense, because it is missing assets, like the icons. Since all these assets are still available through the CDN (see e.g. at jsDelivr, I would expect to still be able to somehow import everything through CDN.To summarize:
web/viewer.html
working through CDN by merely changing the four file references to URL links in these four lines?Including via a CDN
section of the Wiki if the answer is non-trivial.I also understand that according to the documentation one should re-skin the viewer before adding it to their website. So I understand that other parts of the
viewer.html
will not stay the same and that additional styling should be done.Beta Was this translation helpful? Give feedback.
All reactions