ng2-pdfjs-viewer
ng2-pdfjs-viewer copied to clipboard
Angular 14 compatibility
Hello, any plan to update compatibility and dependency to Angular 14?
Soon, Will do in next couple of weeks
Any updates on this? :)
really want support for angular 14 =)
This is the last dependency I need for upgrading a project to Angular 14, so I'll probably start on a PR here soon. I don't believe there will be any particular changes between 13 and 14 that would cause any issues.
I am out of country till school opening. But I should be able to merge changes from your PR. Please let me know once it is ready.
PR is created. Double check the changes, but all I did was bump the versions, create an ng-package.json file since they're required now apparently, merged those module declaration together, and ran build.
In the meantime if anyone is blocked by this you can pull down a special branch I've got that hosts the dist files directly:
"ng2-pdfjs-viewer": "git+https://[email protected]/dereekb/ng2-pdfjs-viewer#82b994d49db5406f64bc39229a04b3871b33d0b5",
Example of it working on my project:

Awaiting for the update .. need it badly.. 4 apps affected.. Please help.
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! While resolving: [email protected] npm ERR! Found: @angular/[email protected] npm ERR! node_modules/@angular/common npm ERR! @angular/common@"^14.1.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/common@"^13.2.2" from [email protected] npm ERR! ng2-pdfjs-viewer@"*" from the root project
@dereekb
In the meantime if anyone is blocked by this you can pull down a special branch I've got that hosts the dist files directly:
You mean the given reference "ng2-pdfjs-viewer": "git+...." should be added to the package.json file under dependencies?
@dereekb
In the meantime if anyone is blocked by this you can pull down a special branch I've got that hosts the dist files directly:
You mean the given reference "ng2-pdfjs-viewer": "git+...." should be added to the package.json file under dependencies?
Yes you can add it to your package.json. But this is a temporary solution
@dereekb
I used your link as a temp solution in package.json. But got the below error:
Error: NG04002: Cannot match any routes. URL Segment: 'assets/pdfjs/web/viewer.html'
Note that I have the below in the angular.json file's options-assets (it was there for the prev version's implementation)
{ "glob": "**/*", "input": "node_modules/ng2-pdfjs-viewer/pdfjs", "output": "/assets/pdfjs" }
Then I manually copied the the node_modules/ng2-pdfjs-viewer/pdfjs
folder to the assets folder and then it worked.
But is this the right way?
I was not required to do this manual copy-paste earlier. Did I miss anything in implementing the temp solution?
Edit: Misread. The README states you need to manually copy this folder. So yes, you are correct.
https://github.com/intbot/ng2-pdfjs-viewer/blob/25973eb38d3676666c09f38b045fd85334a18f41/README.MD#step-2-copy-task-for-pdfjs
## Step 2: Copy task for pdfjs
For several advanced options to work, you need a copy of pdfjs from this npm package.
Edit your project's `angular.json` file and use `ng build` as described here https://angular.io/guide/workspace-config#project-asset-configuration
```json
"assets": [
{ "glob": "**/*", "input": "node_modules/ng2-pdfjs-viewer/pdfjs", "output": "/pdfjs" },
]
_Please note, you may manually Copy `node_modules\ng2-pdfjs-viewer\pdfjs` to your `public` or `asset` folder or use any copy script as part of your build process.
I change the word "may" to "must" in my PR to hopefully reduce confusion in the future.
Any updates on when this will be released?
I will return from vacation on Sep 12th. I could merge this the same week. Anyone interested in being a maintainer, let me know, would be happy to share the responsibilities.
Any updates on the release for this? Thank you!
When exit new release?
@dereekb @Toso82 @NotTheSamAdamsGuy @Laurens-makel @hemant-parmar @sgabb @MotassemJa @Kreash New version is released with Angular 14. Also - Sample app and local deployment scripts are updated.
I am extremely sorry about the delay, I was out of country for a while and got back last week. On a side note @dereekb - Would you like to have permission to merge pull requests? From the looks of it - You went through the code already. I could certainly use a backup in my absence.
Thanks, that's great!