# PDFDocument.whenFullyLoaded()

```ts
whenFullyLoaded(): Promise<void>
```

Only meaningful after `fromUrlProgressive()`. Resolves once every byte has arrived. Editing, export and search need this, which the background fill reaches shortly after opening. When the download can never finish the document stays open for viewing, and a viewer showing it reports the same once on its `error` event.

- Kind: method
- Since: 1.0.0

Returns `Promise<void>`: Resolves once every byte has arrived.

Throws:

- `NETWORK_ERROR` — the download can never finish (a range request kept failing through its retries).
- `ABORTED` — the `signal` was aborted.

```ts
const doc = await PDFDocument.fromUrlProgressive('/big-report.pdf');
await doc.whenFullyLoaded();
const hits = await doc.text.search('Total');
```

Part of [PDFDocument](https://kernstra.com/docs/web-sdk/api/pdfdocument) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/pdfdocument/whenfullyloaded
