Use Pdf Document Result reference
State returned by usePdfDocument: the load status, the document once ready, its page count, the error and a reload function.
Used by
Import
import type { UsePdfDocumentResult } from '@kingtech/react-pdf-viewer';Properties
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
status | PdfDocumentStatus | — | Yes | idle without a source (or after a handled HTTP error). |
document | PDFDocumentProxy | null | — | Yes | The document while ready. Never a destroyed document. |
numPages | number | — | Yes | Page count; 0 without a document. |
error | PdfViewerError | null | — | Yes | The failure while error. |
reload | () => void | — | Yes | Load the current source again. |
Source
packages/react-pdf-viewer/src/hooks/usePdfDocument.ts
Generated from content/react-pdf-viewer/reference/use-pdf-document-result.schema.json. Do not edit by hand.