Closed lihelennn closed 3 years ago
If you are going to add the whole pdf.js package, think about the fact that we will probably want to upgrade it periodically. I'm not sure what recommended best practices are, but in nbv1 we tended to put these packages in a directory with version number so we would know what version we were using.
On 3/23/2021 8:46 PM, Jumana Almahmoud wrote:
@JumanaFM requested changes on this pull request.
Can you please .ignore the client? Also, do we need to add the whole pdf.js package? It's 300+ files.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haystack/nb/pull/124#pullrequestreview-619209896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIWSXQYTBSTBL4RF3W4WZDTFEY6FANCNFSM4ZV2HRDQ.
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/
### NOTE: FIRST MERGE https://github.com/haystack/nbclient/pull/14 in order to use query parameters in the URLs if the base URL does not work.
Workflow:
uploads/
folderreq.headers.origin + nb_viewer.html/?id=<UPLOAD_FILE_ID>
as the url to the PDF file