This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit will copy over the files from a generic build of PDF.js. The build was created by running the following commands: ```sh git clone https://github.com/mozilla/pdf.js.git cd pdf.js npm install -g gulp-cli npm install gulp generic ``` In the project's build folder we find all the files needed. We copy over mostly everything, skipping debug and sandbox files. Also skip the cmaps directory and the demo file. Issue: - https://github.com/scientist-softserv/adventist-dl/issues/667
Using the `.mjs` extension did not seem to work properly, however renaming it to `.js` seems to work fine. This commit renames instances (where needed) of `.mjs` to `.js`.
This commit will add a feature flipper to switch between using PDF.js or Universal Viewer for displaying PDFs. At the moment we have no mechanism to turn off IIIF Print PDF processing, however, that was not indicated as a requirement at this time so that is not included until we have a need for it.
This commit will add the PDF.js viewer to the work show page. It will also add a helper method to the work show presenter to determine if the work has a PDF file. All relevant views will be updated.
This commit will add a PDF's text to the file set's solr document so it can be searched in the catalog. Now we can pass the search term to the viewer so when it loads it will highlight the search term.
In this commit we update #pdf_viewer? to consider child works. If there are any child works this method should return false.
In this commit, we add logic to display the correct pdf type when using s3 locations. We should use the READER pdf if one exists, if not, default to what's available (which likely will be ARCHIVAL).
ShanaLMoore
temporarily deployed
to
production
November 22, 2023 21:27 — with
GitHub Actions
Inactive
kirkkwang
force-pushed
the
i667-install-pdfjs
branch
from
November 22, 2023 23:05
c5ce871
to
fa3d572
Compare
kirkkwang
force-pushed
the
i667-install-pdfjs
branch
from
November 22, 2023 23:27
fa3d572
to
ec3f4b2
Compare
This commit will add a check for the file set's extension (label) instead of solely relying on the mime type. This will allow us to know if it's a PDF (as best as we can anyway) even if CharacterizeJob did not run. Also, downgraded the version of simple_form because it was causing crashes in development.
kirkkwang
force-pushed
the
i667-install-pdfjs
branch
from
November 23, 2023 00:27
ec3f4b2
to
d73a07b
Compare
laritakr
approved these changes
Nov 23, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Co Author: @kirkkwang
Story
This PR installs PDF.js.
The client will have the ability to turn it on/off via a feature flipper switch. When on, the code will also automatically decide when to display the PDF.js. If the work has a pdf with no child works (aka iiif_print failed to split for whatever reason) the viewer will render PDF.js instead of a black UV box.
Additionally, when there is not file download the file served will come from AWS s3 bucket and prioritizes READER.pdf files.
This PR looks big but majority of the files are imported/generated by the PDF.js install. View each commit to get a better idea of code changes, or ignore everything in the public directory.
Refs:
related PR:
TODO/nice to have if we weren't under a time crunch: SPECS for the helper files
Expected Behavior Before Changes
When no child works
example: https://adl.b2.adventistdigitallibrary.org/concern/published_works/20091582_atlantic_union_gleaner_april_22_1957?locale=en
Expected Behavior After Changes
When no child works (the PDF.js viewer should display)
When child works exists (the UV should display)
example: https://adl.b2.adventistdigitallibrary.org/concern/published_works/20092576_atlantic_union_gleaner_april_5_1990?locale=en
When file set failed to characterize
example on prod: https://adl.b2.adventistdigitallibrary.org/concern/published_works/20091854_atlantic_union_gleaner_september_24_1962