Overview
The PdfViewer component provides a full-featured PDF viewing experience with support for annotations, highlighting, and navigation. It’s designed specifically for healthcare document review workflows.Basic Usage
API Reference
PdfViewerProps
string
required
URL of the PDF document to display.
string
Optional identifier for the PDF viewer instance, used for local storage of preferences.
PdfHighlight[]
Array of highlight objects to display on the PDF pages.
Ref<PdfViewerHandle>
Ref to access the PDF viewer handle methods.
function
Callback fired when a PDF page is clicked.
number
The currently selected page number (1-indexed).
boolean
Whether to render PDF annotation layer. Defaults to true.
boolean
Whether to render PDF text layer for text selection. Defaults to true.
SplitterOptions
Options to configure page splitters for document processing workflows.
PdfViewerHandle
function
Navigate to a specific page number by scrolling to it.
PdfHighlight
number
required
The page number (1-indexed) where the highlight appears.
number
required
Left position as a percentage of page width (0-1).
number
required
Top position as a percentage of page height (0-1).
number
required
Width as a percentage of page width (0-1).
number
required
Height as a percentage of page height (0-1).
'yellow' | 'blue'
Highlight color. Defaults to yellow.
SplitterOptions
boolean
Hide the page number text below the splitter.
function
Callback function when a splitter is clicked.
number[]
Array of page numbers after which the splitter is selected.
Features
- Page Navigation: Navigate through PDF pages with controls and virtualized scrolling
- Zoom Controls: Zoom in/out with automatic fit-to-width calculation
- Highlights: Overlay custom highlights on PDF pages with configurable colors
- Page Rotation: Rotate individual pages clockwise or counterclockwise
- Grid View: Switch between standard scroll view and grid thumbnail view
- Page Splitters: Add interactive splitters between pages for document processing
- Responsive: Adapts to container width with automatic scaling
- Performance: Virtualized rendering for smooth scrolling of large documents