Skip to content
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

Helen/pdf to html #124

Merged
merged 1 commit into from
Mar 24, 2021
Merged

Helen/pdf to html #124

merged 1 commit into from
Mar 24, 2021

Conversation

lihelennn
Copy link
Contributor

@lihelennn lihelennn commented Mar 23, 2021

### NOTE: FIRST MERGE haystack/nbclient#14 in order to use query parameters in the URLs if the base URL does not work.

Workflow:

  • User uploads a PDF onto nb. We host that file under the uploads/ folder
  • We save the link to the req.headers.origin + nb_viewer.html/?id=<UPLOAD_FILE_ID> as the url to the PDF file
  • Whenever that link is opened, the PDF.js viewer loads the PDF and also loads NB

image

Copy link
Member

@JumanaFM JumanaFM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please .ignore the client?
Also, do we need to add the whole pdf.js package? It's 300+ files.

@karger
Copy link
Member

karger commented Mar 24, 2021 via email

@lihelennn
Copy link
Contributor Author

lihelennn commented Mar 24, 2021

Instead of using the files, I used CDNs that host the PDF.js files (version 2.6.347).

PDF.js library: https://mozilla.github.io/pdf.js/getting_started/

CDN for viewers: https://cdnjs.com/libraries/pdf.js
CDN for CMAPs directory: https://unpkg.com/pdfjs-dist/

@lihelennn lihelennn requested a review from JumanaFM March 24, 2021 19:54
@JumanaFM JumanaFM merged commit 1564386 into haystack:master Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants