diff --git a/packages/react-pdf/README.md b/packages/react-pdf/README.md
index 4d63709d4..a1e0a1ba0 100644
--- a/packages/react-pdf/README.md
+++ b/packages/react-pdf/README.md
@@ -118,7 +118,7 @@ For most cases, the following example will work:
import { pdfjs } from 'react-pdf';
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
- 'pdfjs-dist/build/pdf.worker.min.js',
+ 'pdfjs-dist/build/pdf.worker.min.mjs',
import.meta.url,
).toString();
```
@@ -141,8 +141,8 @@ For Parcel 2, you need to use a slightly different code:
```diff
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
-- 'pdfjs-dist/build/pdf.worker.min.js',
-+ 'npm:pdfjs-dist/build/pdf.worker.min.js',
+- 'pdfjs-dist/build/pdf.worker.min.mjs',
++ 'npm:pdfjs-dist/build/pdf.worker.min.mjs',
import.meta.url,
).toString();
```
@@ -151,7 +151,7 @@ For Parcel 2, you need to use a slightly different code:
#### Copy worker to public directory
-You will have to make sure on your own that `pdf.worker.js` file from `pdfjs-dist/build` is copied to your project's output folder.
+You will have to make sure on your own that `pdf.worker.mjs` file from `pdfjs-dist/build` is copied to your project's output folder.
For example, you could use a custom script like:
@@ -160,9 +160,9 @@ import path from 'node:path';
import fs from 'node:fs';
const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json'));
-const pdfWorkerPath = path.join(pdfjsDistPath, 'build', 'pdf.worker.js');
+const pdfWorkerPath = path.join(pdfjsDistPath, 'build', 'pdf.worker.mjs');
-fs.copyFileSync(pdfWorkerPath, './dist/pdf.worker.js');
+fs.copyFileSync(pdfWorkerPath, './dist/pdf.worker.mjs');
```
#### Use external CDN
@@ -170,7 +170,7 @@ fs.copyFileSync(pdfWorkerPath, './dist/pdf.worker.js');
```ts
import { pdfjs } from 'react-pdf';
-pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.js`;
+pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
```
#### Legacy PDF.js worker
@@ -179,8 +179,8 @@ If you need to support older browsers, you may use legacy PDF.js worker. To do s
```diff
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
-- 'pdfjs-dist/build/pdf.worker.min.js',
-+ 'pdfjs-dist/legacy/build/pdf.worker.min.js',
+- 'pdfjs-dist/build/pdf.worker.min.mjs',
++ 'pdfjs-dist/legacy/build/pdf.worker.min.mjs',
import.meta.url,
).toString();
```
@@ -188,8 +188,8 @@ If you need to support older browsers, you may use legacy PDF.js worker. To do s
or:
```diff
--pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.js`;
-+pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.js`;
+-pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
++pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.mjs`;
```
### Usage
@@ -499,7 +499,7 @@ Loads a document passed using `file` prop.
| onSourceError | Function called in case of an error while retrieving document source from `file` prop. | n/a | `(error) => alert('Error while retrieving document source! ' + error.message)` |
| onSourceSuccess | Function called when document source is successfully retrieved from `file` prop. | n/a | `() => alert('Document source retrieved!')` |
| options | An object in which additional parameters to be passed to PDF.js can be defined. Most notably:
`cMapUrl`;
`httpHeaders` - custom request headers, e.g. for authorization);
`withCredentials` - a boolean to indicate whether or not to include cookies in the request (defaults to `false`)
For a full list of possible parameters, check [PDF.js documentation on DocumentInitParameters](https://mozilla.github.io/pdf.js/api/draft/module-pdfjsLib.html#~DocumentInitParameters).
**Note**: Make sure to define options object outside of your React component, and use `useMemo` if you can't.
**Note**: `isEvalSupported` is forced to `false` to prevent [arbitrary JavaScript execution upon opening a malicious PDF file](https://github.com/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq). | n/a | `{ cMapUrl: '/cmaps/' }` |
-| renderMode | Rendering mode of the document. Can be `"canvas"`, `"custom"`, `"none"` or `"svg"`. If set to `"custom"`, `customRenderer` must also be provided. **Warning**: SVG render mode is deprecated and will be removed in the future. | `"canvas"` | `"custom"` |
+| renderMode | Rendering mode of the document. Can be `"canvas"`, `"custom"` or `"none"`. If set to `"custom"`, `customRenderer` must also be provided. | `"canvas"` | `"custom"` |
| rotate | Rotation of the document in degrees. If provided, will change rotation globally, even for the pages which were given `rotate` prop of their own. `90` = rotated to the right, `180` = upside down, `270` = rotated to the left. | n/a | `90` |
### Page
@@ -510,8 +510,8 @@ Displays a page. Should be placed inside ``. Alternatively, it can h
| Prop name | Description | Default value | Example values |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| canvasBackground | Canvas background color. Any valid `canvas.fillStyle` can be used. If you set `renderMode` to `"svg"` this prop will be ignored. | n/a | `"transparent"` |
-| canvasRef | A prop that behaves like [ref](https://reactjs.org/docs/refs-and-the-dom.html), but it's passed to `