streamlit-pdf-viewer icon indicating copy to clipboard operation
streamlit-pdf-viewer copied to clipboard

Update pdf.js to version 4

Open lfoppiano opened this issue 1 year ago • 4 comments

PDF.js 4.0 is a major release that contains a number of API changes, features and bugfixes. The following changes are highlighted:

    Conversion to JavaScript modules for the builds
    Conversion to Fluent for localization
    Optimizations for CPU and memory usage
    Improvements and bugfixes for the annotation editor and annotation rendering
    Removal of the deprecated SVG back-end
    Removal of other deprecated functionality and options

lfoppiano avatar Feb 21 '24 13:02 lfoppiano

One of the limitation of this release is that node should be >= 18.

lfoppiano avatar May 11 '24 22:05 lfoppiano

https://github.com/lfoppiano/streamlit-pdf-viewer/security/dependabot/1

lfoppiano avatar May 17 '24 12:05 lfoppiano

image

https://github.com/lfoppiano/streamlit-pdf-viewer/commit/5f09846fbc5b4cd71ab910f98b343d681e5808ed

I've modified the method for loading pdfjs-dist and fixed transpilation settings. With these changes, the text is now displayed on top of the PDF in my environment as shown in the attached file. The position is still misaligned, though. 🤔

Since I have updated several library versions, you will need to delete node_modules and package-lock.json once to run in your environment.

t29mato avatar May 22 '24 02:05 t29mato

Thanks great! Thanks!

lfoppiano avatar May 22 '24 03:05 lfoppiano