-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade PDFJS #203
Upgrade PDFJS #203
Conversation
Thanks a lot for the work, this is not an easy one :) About your comments:
I think we should really explore this option, to avoid adding all the built file in the repo. I guess you have already tried it, but what was the issue when doing the following?
This should expose a const document = pdfjsLib.getDocument(pdfUrl);
... This should avoid building PDF.js with webpack. And about:
Why did you start with v3, and not directly with v4? |
Recap of our discussion on how to proceed. The main point is that we would like to remove all hardcoded static assets from the GH repo for the various obvious reasons. In This is an example of a {
"aliases": {
...
"@scss/invenio_previewer": "scss/invenio_previewer"
},
"build": {
"assetsPath": "/Users/nico/.pyenv/versions/3.9.16/envs/cdsvideos39/var/instance/static/dist",
"assetsURL": "/static/dist/",
"context": "/Users/nico/.pyenv/versions/3.9.16/envs/cdsvideos39/var/instance/assets",
"debug": false,
"staticPath": "/Users/nico/.pyenv/versions/3.9.16/envs/cdsvideos39/var/instance/static",
"staticURL": "/static/"
},
"entry": {
"adminlte": "./js/invenio_theme/admin.js",
"base": "./js/invenio_theme/base.js",
....
"theme": "./scss/invenio_theme/theme.scss",
"theme-admin": "./scss/invenio_theme/admin.scss"
}
} You can see an example how the various config are used in the Webpack config, for example here. What we want to achieve is to make the ...
copy: [{
from: <path>,
to: <path>
}] (naming and final object structure maybe different) Possible tasks:
|
I've started an implementation of
|
❤️ Thank you for your contribution!
Close #170
Close https://github.com/zenodo/ops/issues/438
Close https://github.com/zenodo/ops/issues/278
Description
Upgrade PDF JS from 1.x to 3.x. This corrects the issue with displaying characters incorrectly and self printing PDFs
This is a large PR so here is how the files are structured:
/static/js/pdfjs/
and is a subset of the the files from https://www.npmjs.com/package/pdfjs-dist/v/3.11.174assets/semantic-ui/css/viewer.css
templates/semantic-ui/invenio_previewer/pdfjs.html
/assets/semantic-ui/js/invenio_previewer/pdfjs/web/images
/static/js/pdfjs/web/images/
to:
invenio-previewer/invenio_previewer/assets/semantic-ui/css/invenio_previewer/pdfjs/images
/assets/semantic-ui/js/invenio_previewer/pdfjs/web/locale
/static/js/pdfjs/web/locale/
to:
/static/js/pdfjs/
cmaps/
andstandard_fonts/
have been added tostatic/js/pdfjs
The changes I have made are:
CHANGED
comments where I have made changes (for some reason the PDF url is hardcoded by default)The files to be reviewed are:
Before and after (demonstrating that the character rendering issues have been fixed)
To do:
Shelve:
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: