View as Markdown

API reference: @salmonui/export/pdf

PdfExportOptionsinterface

import type { PdfExportOptions } from '@salmonui/export/pdf';
interface PdfExportOptions<Row> extends ExportOptions<Row>, PdfOptions {
}
PdfExportOptions members (23, 23 inherited)
NameSignatureDescription
pagesoptionalinheritedpages?: "all" | "current";

all (default): every page of the current query. current: the current page as shown.

includeHiddenColumnsoptionalinheritedincludeHiddenColumns?: boolean;

Include hidden columns. Default false.

rowsoptionalinheritedrows?: readonly Row[];

Rows to export instead of the grid rows (for example the selected rows), with the grid's columns.

columnsoptionalinheritedcolumns?: readonly ExportColumnOption[];

Export-only columns, in order.

fileNameoptionalinheritedfileName?: string;

Download name; the format extension is added when missing. Default export.

hierarchyoptionalinheritedhierarchy?: "all" | "expanded" | "none";

Detail and child-grid rows: expanded (default), all, or none.

treeoptionalinheritedtree?: "all" | "expanded";

Tree mode rows: expanded (default) exports the visible rows in pre-order; all exports every kept row regardless of expansion (XLSX outlineCollapsed then keeps the collapsed state).

stylesoptionalinheritedstyles?: ExportStyles;
sliceMsoptionalinheritedsliceMs?: number;

Time slice in ms before the writer yields to the event loop. Default 25.

yieldoptionalinheritedyield?: YieldFn;

Awaited between slices. Default: a macrotask.

pageSizeoptionalinheritedpageSize?: readonly [number, number] | PdfPageSize;

Default a4, or [width, height] in points.

orientationoptionalinheritedorientation?: "landscape" | "portrait";

Default portrait.

marginoptionalinheritedmargin?: number;

Page margin in points. Default 36.

fontSizeoptionalinheritedfontSize?: number;

Body font size in points. Default 8.

columnOverflowoptionalinheritedcolumnOverflow?: "fit" | "paginate";

fit (default) scales columns to the page width; paginate continues them on extra page sets.

headeroptionalinheritedheader?: string;

Page header text; {page} and {pages} are replaced.

footeroptionalinheritedfooter?: string;

Page footer text; default {page} / {pages}. Empty string for none.

includeHeadersoptionalinheritedincludeHeaders?: boolean;

Header rows. Default true.

titleoptionalinheritedtitle?: string;

Document title (/Title).

compressoptionalinheritedcompress?: boolean;

Deflate content streams (when the platform has CompressionStream). Default true.

fontoptionalinheritedfont?: PdfFont | PdfFontData;

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.

mergeRepeatedValuesoptionalinheritedmergeRepeatedValues?: boolean;

Merge repeated values in consecutive data rows, as XLSX. Default false.

appendImagesoptionalinheritedappendImages?: readonly ExportImage[];

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.