# PdfOptions (@salmonui/export/pdf)

> The PdfOptions interface of @salmonui/export/pdf: PDF writer options.

Canonical: https://salmonui.dev/docs/reference/export/pdf/PdfOptions

```ts
import type { PdfOptions } from '@salmonui/export/pdf';
```

Entry index: https://salmonui.dev/docs/reference/export/pdf (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/export/pdf.md).

## Reference

Kind: interface

```ts
interface PdfOptions extends ExportWriterOptions {
    readonly pageSize?: PdfPageSize | readonly [
        number,
        number
    ];
    readonly orientation?: 'portrait' | 'landscape';
    readonly margin?: number;
    readonly fontSize?: number;
    readonly columnOverflow?: 'fit' | 'paginate';
    readonly header?: string;
    readonly footer?: string;
    readonly includeHeaders?: boolean;
    readonly title?: string;
    readonly compress?: boolean;
    readonly font?: PdfFont | PdfFontData;
    readonly mergeRepeatedValues?: boolean;
    readonly appendImages?: readonly ExportImage[];
}
```

PDF writer options.

Members (16):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pageSize` | `readonly pageSize?: PdfPageSize \| readonly [     number,     number ];` | optional | Default `a4`, or `[width, height]` in points. |
| `orientation` | `readonly orientation?: 'portrait' \| 'landscape';` | optional | Default `portrait`. |
| `margin` | `readonly margin?: number;` | optional | Page margin in points. Default 36. |
| `fontSize` | `readonly fontSize?: number;` | optional | Body font size in points. Default 8. |
| `columnOverflow` | `readonly columnOverflow?: 'fit' \| 'paginate';` | optional | `fit` (default) scales columns to the page width; `paginate` continues them on extra page sets. |
| `header` | `readonly header?: string;` | optional | Page header text; `{page}` and `{pages}` are replaced. |
| `footer` | `readonly footer?: string;` | optional | Page footer text; default `{page} / {pages}`. Empty string for none. |
| `includeHeaders` | `readonly includeHeaders?: boolean;` | optional | Header rows. Default true. |
| `title` | `readonly title?: string;` | optional | Document title (`/Title`). |
| `compress` | `readonly compress?: boolean;` | optional | Deflate content streams (when the platform has `CompressionStream`). Default true. |
| `font` | `readonly font?: PdfFont \| PdfFontData;` | optional | TrueType font bytes (`.ttf`, or the first font of a `.ttc`) to embed for all text, required for characters outside WinAnsi (CJK, Cyrillic, Greek, Hebrew, Arabic). Only the used glyphs are embedded. `bold` defaults to a synthetic bold of `regular`. No font is bundled. |
| `mergeRepeatedValues` | `readonly mergeRepeatedValues?: boolean;` | optional | Merge repeated values in consecutive data rows, as XLSX. Default false. |
| `appendImages` | `readonly appendImages?: readonly ExportImage[];` | optional | Pages after the table, one PNG or JPEG image each (`width` / `height` in CSS px), scaled down to fit the page body and centered: a chart image beside the table in one PDF. An image that cannot be embedded adds no page. |
| `styles` | `styles?: ExportStyles;` | optional, inherited |  |
| `sliceMs` | `sliceMs?: number;` | optional, inherited | Time slice in ms before the writer yields to the event loop. Default 25. |
| `yield` | `yield?: YieldFn;` | optional, inherited | Awaited between slices. Default: a macrotask. |
