PdfViewerToolbar API
Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.
PdfViewerToolbar7 props2 callbacks15 methods
Props7
| Name | Type | Description |
|---|---|---|
controllerRequired |
| Controller instance used to invoke actions and read the current state. |
stateRequired |
| Current state snapshot used to render the component. |
configOptional |
| Toolbar groups, visibility and button options. false hides all tools; an array chooses groups; an object configures individual controls. |
textOptional |
| Partial overrides for the default PDF viewer toolbar labels. |
searchOpenOptional | boolean | undefined | Whether the viewer search field is currently shown. |
searchIdOptional | string | undefined | ID for the search field and its accessibility associations. |
appendToOptional |
| DOM container for floating viewer toolbar content. |
Events and callbacks2
| Name | Type | Description |
|---|---|---|
onOpenRequired |
| Requests that the parent open the surface or file chooser. |
onToggleSearchRequired |
| Requests toggling the search panel and supplies its triggering element for focus restoration. |
Methods15
| Name | Signature | Description |
|---|---|---|
PdfViewerController.setPrintTitle |
| Update translated print-frame accessibility text without reloading the PDF. Available through |
PdfViewerController.retry |
| Retries loading the last source after an error. Available through |
PdfViewerController.setCallbacks |
| Update event handlers without recreating the document or its worker. Available through |
PdfViewerController.subscribe |
| Subscribes to viewer state changes; returns an unsubscribe function. Available through |
PdfViewerController.attach |
| Initializes the viewer in its container before loading a document. Available through |
PdfViewerController.load |
| The latest source wins. Empty/null clears the document. Failures are exposed in snapshot/onError. Available through |
PdfViewerController.goToPage |
| Navigates to a one-based page number, clamped to the document page count. Available through |
PdfViewerController.setZoom |
| Applies a numeric scale or page-width/page-fit mode when a document is ready. Available through |
PdfViewerController.rotate |
| Rotates all pages clockwise by 90 degrees. Available through |
PdfViewerController.search |
| Searches the document; previous selects search direction and again continues to the next match. Available through |
PdfViewerController.clearSearch |
| Closes the search state and removes match highlighting. Available through |
PdfViewerController.download |
| Downloads the currently loaded PDF. Available through |
PdfViewerController.print |
| Prepares and opens the print view for the loaded PDF. Available through |
PdfViewerController.cancelPrint |
| Cancels an in-progress print preparation. Available through |
PdfViewerController.destroy |
| Releases the document, worker, listeners and viewer resources. Available through |