Pdf Page Canvas Props reference
Props for PdfPageCanvas: the document and page to render, its scale, rotation and fit, the optional layers and the render callbacks.
Used by
Import
import type { PdfPageCanvasProps } from '@kingtech/react-pdf-viewer';Properties
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
document | PDFDocumentProxy | — | Yes | A loaded document, e.g. from usePdfDocument. |
page | number | — | Yes | 1-based page; clamped to the document. |
scale | number | 1 | No | Scale, 1 = 100%. |
rotation | Rotation | 0 | No | Added to the page’s intrinsic rotation. |
fit | FitOptions | — | No | A box the page must fit into. |
maxCanvasPixels | number | 16_777_216 | No | Canvas pixel budget. |
textLayer | boolean | false | No | Selectable text layer. |
annotationLayer | boolean | false | No | Clickable links. |
highlight | PageHighlight | — | No | Search matches to highlight (requires textLayer). |
onLinkNavigate | (page: number) => void | — | No | An internal link targets another page. |
onHighlight | (element: HTMLElement) => void | — | No | Receives the selected match’s element, e.g. to scroll it into view. |
aria-label | string | — | No | Accessible name, e.g. Page 1 of 3. With a name the page is an image (a group with textLayer); without one it is decorative. |
className | string | — | No | Added to the page element. |
style | CSSProperties | — | No | Inline styles on the page element. |
renderError | (error: PdfViewerError, actions: { retry: () => void }) => ReactNode | — | No | Replaces the in-place error view. |
onRender | (info: PageRenderInfo) => void | — | No | After each completed render. |
onError | (error: PdfViewerError) => void | — | No | Rendering failed (cancellations are not failures). |
Source
packages/react-pdf-viewer/src/components/PdfPageCanvas.tsx
Generated from content/react-pdf-viewer/reference/pdf-page-canvas-props.schema.json. Do not edit by hand.