Skip to content

Commit

Permalink
Merge pull request #1134 from studioromeo/patch-1
Browse files Browse the repository at this point in the history
fix: Update documentation to reference 4.x pdf.js worker extension
  • Loading branch information
VadimDez authored Sep 18, 2024
2 parents 1af9d33 + 2659b40 commit 2e15eea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,9 @@ onFileSelected() {

By default the `worker` is loaded from `cdn.jsdelivr.net`.

In your code update `path` to the worker to be for example `/pdf.worker.js`
In your code update `path` to the worker to be for example `/pdf.worker.mjs`
```typescript
(window as any).pdfWorkerSrc = '/pdf.worker.js';
(window as any).pdfWorkerSrc = '/pdf.worker.mjs';
```

*This should be set before `pdf-viewer` component is rendered.*
Expand All @@ -524,7 +524,7 @@ but using different versions of pdf.worker, support has been added. You can do
above, except that you can append the specific version of pdfjs required and override the
custom path *just for that version*. This way setting the global window var won't conflict.
```typescript
(window as any)["pdfWorkerSrc2.14.305"] = '/pdf.worker.js';
(window as any)["pdfWorkerSrc2.14.305"] = '/pdf.worker.mjs';
```

## Search in the PDF
Expand Down

0 comments on commit 2e15eea

Please sign in to comment.