Ngx-extended-pdf-viewer: Seemingly conflicting how-to-build.md Instructions

Created on 21 Jul 2020  路  6Comments  路  Source: stephanrauh/ngx-extended-pdf-viewer

I have been attempting to build the ngx-extended-pdf-viewer library from scratch, so as to incorporate a slightly-modified pdf.js. The provided walkthrough, however, seems to conflict with both itself and the updateMozillasPdfViewer.sh/.bat scripts.

Steps 2-11 involve building pdf.js in an embedded-pdf folder, although navigation in steps 12-14 assume pdf.js was not nested within any folder.

Step 14's update scripts refer to a mypdf.js directory for the pdf.js build, despite the build instructions referring to mozillas-pdf.js.

In an attempt to avoid these issues, I place the cloned pdf.js repo in the same directory as this repo, and rename it to mypdf.js. The updateMozillasPdfViewer.bat script and npm run win-package then run without any explicit errors.

Unfortunately, ng serve results in a "properly" compiled Angular project which fails to display anything due to unreachable resources (404s for runtime.js, pollyfills.js, styles.js (those don't exist within src to begin with, perhaps a package.json issue?)).

Any advice on how to build from source? Have I unintentionally been going about this all wrong? Thank you in advance!

Confirmed Solved documentation

All 6 comments

Oh, sorry. I've forgotten to delete or update the walkthrough. I've started to maintain my own modified fork of pdf.js:

https://github.com/stephanrauh/pdf.js

Clone it into a folder called "mypdf.js". updateMozillasPdfViewer.sh compiles mypdf.js and copies it into the ngx-extended-pdf-viewer folder.

After that, you can run npm run unix-package.

I hope the Windows files work, too. If you run into trouble, check the unix files. I run them much more often than the Windows files. Sometime it happens that I'm in a hurry and forget to test both sets of files.

Thanks for the quick response! It turns out that, for the end result issue, I simply had to point the <base href...> in index.html to the root directory; ng serve seems to work fine then, though I'll have to see if this creates any other problems. Otherwise, it appears both your Windows and Unix build scripts work well. Thanks again!

You've already closed the ticket before I managed to update the walkthrough. :)

Now I've updated it. Can I invite you to proof-read it? Does it work not?

Thanks in advance,
Stephan

Gah, sorry about that! I'm inexperienced to the issue workflow, got a bit trigger-happy :). Will proof-read and test now...

Awesome! Thanks in advance!

Sorry for the delay with finalizing testing! Runs without any issues, from my standpoint!

Was this page helpful?
0 / 5 - 0 ratings