Skip to content
React PDF Viewer

Search

PdfPageCanvasProps 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

NameTypeDefaultRequiredDescription
documentPDFDocumentProxy—YesA loaded document, e.g. from usePdfDocument.
pagenumber—Yes1-based page; clamped to the document.
scalenumber1NoScale, 1 = 100%.
rotationRotation0NoAdded to the page’s intrinsic rotation.
fitFitOptions—NoA box the page must fit into.
maxCanvasPixelsnumber16_777_216NoCanvas pixel budget.
textLayerbooleanfalseNoSelectable text layer.
annotationLayerbooleanfalseNoClickable links.
highlightPageHighlight—NoSearch matches to highlight (requires textLayer).
onLinkNavigate(page: number) => void—NoAn internal link targets another page.
onHighlight(element: HTMLElement) => void—NoReceives the selected match’s element, e.g. to scroll it into view.
aria-labelstring—NoAccessible name, e.g. Page 1 of 3. With a name the page is an image (a group with textLayer); without one it is decorative.
classNamestring—NoAdded to the page element.
styleCSSProperties—NoInline styles on the page element.
renderError(error: PdfViewerError, actions: { retry: () => void }) => ReactNode—NoReplaces the in-place error view.
onRender(info: PageRenderInfo) => void—NoAfter each completed render.
onError(error: PdfViewerError) => void—NoRendering 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.