# UsePdfDocumentResult reference

State returned by `usePdfDocument`: the load status, the document once ready, its page count, the error and a reload function.

## Used by

- [Headless](https://react-pdf-viewer-chi.vercel.app/react-pdf-viewer/headless.md)

## Import

```ts
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](https://github.com/kiralygyula92/react-pdf-viewer/blob/main/packages/react-pdf-viewer/src/hooks/usePdfDocument.ts#L28)

