# PDFExporter.getBase64()

```ts
getBase64(options?: ExportOptions): Promise<string>
```

Get exported PDF as a base64 string. Needs `export`.

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `options?` | `ExportOptions` | `{ flatten?, invalidateSignatures?, pages?, onProgress?, signal? }`. |

Returns `Promise<string>`

Throws:

- `FEATURE_NOT_LICENSED` when the license lacks `export`.
- `INVALID_ARGUMENT` when `pages` is empty or names a page the document does not have.
- `INVALID_STATE` when `flatten` is asked of a signed document without `invalidateSignatures`; from a viewer's exporter, when pending edits cannot be written or the document was reloaded under it.
- `PAGE_ERROR` when a page cannot be loaded for flattening.
- `EXPORT_FAILED` when the document cannot be written.
- `ABORTED` when `signal` aborts.
- `DOCUMENT_CLOSED` after `doc.close()`.

```ts
const base64 = await viewer.createExporter().getBase64();
```

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

Web page: https://kernstra.com/docs/web-sdk/api/pdfexporter/getbase64
