Closed lfoppiano closed 1 month ago
I've imported the CSS
pdfjs-dist/web/pdf_viewer.css
but it seems there are references to svg images that do not exist:--alt-text-add-image: url(images/altText_add.svg); --alt-text-done-image: url(images/altText_done.svg);
It looks like those files are included just fine in an up-to-date build, according to https://github.com/mozilla/pdf.js/blob/63b66b412cb3be6919c14436487c667a1597a732/gulpfile.mjs#L1119-L1126
PDF.js version: 3.11.174
That version is no longer supported, please find the latest releases at https://mozilla.github.io/pdf.js/getting_started/#download
For future reference: Please make sure to always test the latest version, since that's the only one we support, before reporting a bug or asking for help.
@Snuffleupagus thanks a lot for your quick answer.
I might overlooking something here. I've deleted and re-installed all my dependencies using NPM:
These files are not there in my node_modules
:
Also I did not see them in the same version in NPMjs:
https://www.npmjs.com/package/pdfjs-dist/v/3.11.174?activeTab=code
Any idea what I'm doing wrong?
Using version 4 is also my hope some day, I haven't managed to update from version 3 to version 4. There seems to have been several breaking changes in how the modules are loaded.
There was a pdf_worker.entry
which disappers in version 4:
Is there an upgrade guide? I could not find it...
These files are not there in my
node_modules
:
Note that they are included in https://www.npmjs.com/package/pdfjs-dist/v/4.2.67?activeTab=code, which as already mentioned is the only version that we support.
Another reason to update is that the version you're using contains a security vulnerability, see https://github.com/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq
There was a
pdf.worker.entry
which disappers in version 4:
That old file caused the worker-code to be loaded on the main-thread which results in really bad performance, hence why it's removed.
I'm happy to update, but do you have any documentation for that?
I'm using PDF.js programmatically in a component for streamlit, which uses vue.js as js framework. I've imported the CSS
pdfjs-dist/web/pdf_viewer.css
but it seems there are references to svg images that do not exist:Commenting these lines seems to solve the problem (not sure if it's creating new ones).
Configuration:
Steps to reproduce the problem:
pdfjs-dist/web/pdf_viewer.css
What is the expected behavior? (add screenshot)
That it works
What went wrong? (add screenshot)
Here the build error: https://github.com/lfoppiano/streamlit-pdf-viewer/actions/runs/9135512859/job/25122945743