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

Feature request: update to latest pdf.js v2.7.570 #714

Closed
igorlino opened this issue Jan 25, 2021 · 10 comments
Closed

Feature request: update to latest pdf.js v2.7.570 #714

igorlino opened this issue Jan 25, 2021 · 10 comments

Comments

@igorlino
Copy link

igorlino commented Jan 25, 2021

Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [ ] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

https://github.com/mozilla/pdf.js/releases

pdf viewer does not contain the last 3 minor releases:
v2.7.570 …
18 hours ago f2c7338 zip tar.gz Notes https://github.com/mozilla/pdf.js/releases/tag/v2.7.570
v2.6.347 …
on 3 Sep 2020 3be9c65 zip tar.gz Notes https://github.com/mozilla/pdf.js/releases/tag/v2.6.347
v2.5.207 …
on 1 Jun 2020 0974d60 zip tar.gz Notes https://github.com/mozilla/pdf.js/releases/tag/v2.5.207

Perhaps is a good time to update to v2.7.570 that includes several performance improvements.

@cvjanick
Copy link

Also if going to v2.7.570 please use the minified versions of es2015 or later or provide option to do so for smaller code and better performance. See the nice but somewhat bloated ngx-extended-pdf-viewer for some examples, going minified might make this lightweight ng2-pdf-viewer library even better.

@igorlino
Copy link
Author

igorlino commented Jan 27, 2021

@cvjanick when the pdf-js npm dependency is node_modules/pdfjs-dist/build, you have the minified versions available there
I think that package is only a dependency and Vadim cannot change anything about it.

At the moment I have 2 changes in my project to make things work:
1)
in angular.json
image

  1. app.module.ts
export class AppModule implements DoBootstrap {

    ngDoBootstrap(appRef: ApplicationRef) {
        // Set custom path to the worker to avoid loading of CDN
        if (environment.production) {
            (window as any).pdfWorkerSrc = '/assets/pdf.worker.min.js';
        }

this was needed because the dynamic CDN loading was blocked by the security content policy which we restricted.

@cvjanick
Copy link

cvjanick commented Mar 3, 2021

Thank you igorlino will give that a try.

@cvjanick
Copy link

cvjanick commented Mar 3, 2021

Also thanks to both Stephan and Vadim - two great libraries! Using both for different purposes.

@magorismagor
Copy link

+1 to this Feature Request!

@stale
Copy link

stale bot commented Jun 25, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 25, 2021
@stale stale bot closed this as completed Jul 25, 2021
@VadimDez VadimDez reopened this Jul 26, 2021
@stale stale bot removed the stale label Jul 26, 2021
@igorlino
Copy link
Author

@VadimDez sorry to spam, in the meantime there are 6 releases, not sure if it is hard to integrate to the latest one, but each release seems to contain a very significant amount of features/bug fixes/performance improvements.

v2.10.377 …
on Jul 25 156762c
v2.9.359 …
on May 30 e667c8c
v2.8.335 …
on Apr 5 228adbf
v2.7.570 …
on Jan 24 f2c7338
v2.6.347 …
on Sep 3, 2020 3be9c65
v2.5.207 …
on Jun 1, 2020 0974d60

https://github.com/mozilla/pdf.js/releases

@igorlino
Copy link
Author

sorry my bad, there you did already a release in #777, so technically you covered already the reported releases.
Please consider if a new ticket is needed for the next 3 releases, or this ticket can be retaken to cover once again

@beckedorf
Copy link

FYI I created a quick, temporary fix, if you want to use it:

https://github.com/beckedorf/ng2-pdf-viewer
https://www.npmjs.com/package/pdf-forms-viewer-temp

@VadimDez
Copy link
Owner

Closed by #829

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants