Skip to content

Commit

Permalink
docs: add doc for workerSrc
Browse files Browse the repository at this point in the history
  • Loading branch information
Priestch committed Mar 31, 2024
1 parent 2c2b354 commit 20e90a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Binary file added docs/assets/worker-request.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion docs/learned-knowledge/parts/app-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Let's crack on them one by one!
- `defaultUrl`
- `locale`
- `workerSrc`
- `sandboxBundleSrc`

#### defaultUrl

Expand All @@ -28,3 +27,11 @@ The url of the PDF file. If you got [CORS](https://developer.mozilla.org/en-US/d
- Default `en-US`

The locale of the viewer, it easy to switch a different locale by setting this option. See all supported locales in folder [l10n](https://github.com/mozilla/pdf.js/tree/master/l10n).

#### workerSrc

The url of the PDF.js web worker bundle.

The PDF.js project use web worker to speed up the rendering process, it means there must be some code creating and initializing the web worker using the `workerSrc`. It configured with default value, but it always depends on how you deploy it. Make sure you can download the worker bundle from the `workerSrc` url.

![Worker Request](/assets/worker-request.png)

0 comments on commit 20e90a0

Please sign in to comment.