# PdfSource reference

A PDF document source: a URL for the viewer to fetch, or a file or bytes that are already in memory.

- `string` / `URL`: fetched by the viewer (see `PdfRequestOptions`).
- `ArrayBuffer` / `Uint8Array` / `Blob` (including `File`): read directly, nothing is uploaded.

Strings compare by value; every other source compares by identity, so keep binary sources referentially stable (e.g. in state) to avoid reloading on every render.

## Used by

- [Document sources](https://react-pdf-viewer-chi.vercel.app/react-pdf-viewer/document-sources.md)

## Import

```ts
import type { PdfSource } from '@kingtech/react-pdf-viewer';
```

Signature: `type PdfSource = string | URL | ArrayBuffer | Uint8Array | Blob`

## Source

[packages/react-pdf-viewer/src/types.ts](https://github.com/kiralygyula92/react-pdf-viewer/blob/main/packages/react-pdf-viewer/src/types.ts#L15)

