From 78e123de0ce657cb4911fd9b11a9f0806db470ac Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Thu, 4 Jan 2024 22:52:31 +0100 Subject: [PATCH] Make it clear SVG renderMode is deprecated and will be removed in the future --- packages/react-pdf/README.md | 4 ++-- packages/react-pdf/src/Document.tsx | 4 ++-- packages/react-pdf/src/Page.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/react-pdf/README.md b/packages/react-pdf/README.md index ed44f5867..cf5fb75f5 100644 --- a/packages/react-pdf/README.md +++ b/packages/react-pdf/README.md @@ -470,7 +470,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: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. | 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 no longer maintained and may be removed in the future. | `"canvas"` | `"svg"` | +| 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"` | | 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 @@ -512,7 +512,7 @@ Displays a page. Should be placed inside ``. Alternatively, it can h | pdf | pdf object obtained from ``'s `onLoadSuccess` callback function. | (automatically obtained from parent ``) | `pdf` | | renderAnnotationLayer | Whether annotations (e.g. links) should be rendered. | `true` | `false` | | renderForms | Whether forms should be rendered. `renderAnnotationLayer` prop must be set to `true`. | `false` | `true` | -| 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 no longer maintained and may be removed in the future. | `"canvas"` | `"svg"` | +| 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"` | | renderTextLayer | Whether a text layer should be rendered. | `true` | `false` | | rotate | Rotation of the page in degrees. `90` = rotated to the right, `180` = upside down, `270` = rotated to the left. | Page's default setting, usually `0` | `90` | | scale | Page scale. | `1` | `0.5` | diff --git a/packages/react-pdf/src/Document.tsx b/packages/react-pdf/src/Document.tsx index 1480f1eba..d67ea5353 100644 --- a/packages/react-pdf/src/Document.tsx +++ b/packages/react-pdf/src/Document.tsx @@ -201,10 +201,10 @@ export type DocumentProps = { /** * 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 no longer maintained and may be removed in the future. + * **Warning**: SVG render mode is deprecated and will be removed in the future. * * @default 'canvas' - * @example 'svg' + * @example 'custom' */ renderMode?: RenderMode; /** diff --git a/packages/react-pdf/src/Page.tsx b/packages/react-pdf/src/Page.tsx index bd922f050..314b067e4 100644 --- a/packages/react-pdf/src/Page.tsx +++ b/packages/react-pdf/src/Page.tsx @@ -273,10 +273,10 @@ export type PageProps = { /** * 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 no longer maintained and may be removed in the future. + * **Warning**: SVG render mode is deprecated and will be removed in the future. * * @default 'canvas' - * @example 'svg' + * @example 'custom' */ renderMode?: RenderMode; /**