Skip to content

Commit

Permalink
Merge pull request #311 from VadimDez/feature/#302
Browse files Browse the repository at this point in the history
Update pdfjs
  • Loading branch information
VadimDez authored Apr 19, 2018
2 parents bc99896 + bfdbdbb commit 86e03ed
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 73 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ By default the `worker` is loaded from `cdnjs.cloudflare.com`.

In your code update `path` to the worker to be for example `/pdf.worker.js`
```typescript
(<any>window).PDFJS.workerSrc = '/pdf.worker.js';
(<any>window).pdfWorkerSrc = '/pdf.worker.js';
```
*This should be set before `pdf-viewer` component is rendered.*

Expand Down
145 changes: 94 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
"homepage": "https://github.com/VadimDez/ng2-pdf-viewer#readme",
"peerDependencies": {
"@angular/core": ">=5.0.0",
"pdfjs-dist": "1.9.489",
"@types/pdfjs-dist": "^0.1.1"
"pdfjs-dist": "2.0.489",
"@types/pdfjs-dist": "^0.1.2"
},
"dependencies": {
"@types/pdfjs-dist": "^0.1.1",
"pdfjs-dist": "1.9.489"
"@types/pdfjs-dist": "^0.1.2",
"pdfjs-dist": "2.0.489"
},
"devDependencies": {
"@angular/animations": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class AppComponent {
* Set custom path to pdf worker
*/
setCustomWorkerPath() {
(<any>window).PDFJS.workerSrc = '/lib/pdfjs-dist/build/pdf.worker.js';
(<any>window).pdfWorkerSrc = '/lib/pdfjs-dist/build/pdf.worker.js';
}

incrementPage(amount: number) {
Expand Down
Loading

0 comments on commit 86e03ed

Please sign in to comment.