This page documents the PDF Export API and interfaces.
Grid Properties Copy Link
API Methods Copy Link
Interfaces Copy Link
PdfExportParams Copy Link
Properties available on the PdfExportParams interface.
The document title stored in the PDF metadata. When set, a visible title is rendered above the exported table.
|
Styling for the visible document title.
|
Override PDF colours. Any missing values fall back to the current theme.
|
Set to true to skip applying grid style definitions and callbacks (rowStyle, getRowStyle, colDef.cellStyle, colDef.headerStyle). Use this when you want to rely only on colors and theme defaults. |
Callback that allows overriding styles for rows, cells, row groups, headers and group headers during PDF export. Returned styles are merged after resolved grid styles and take precedence.
|
Callback that provides an external URI for an exported body cell. The returned URI is added to the PDF as a clickable link annotation.
|
Page size, orientation and margins.
|
Base font size for body rows in points. |
Base font size for header rows in points. |
Base font family for body rows. |
Font family for header rows. |
Padding inside each cell in points. |
Controls exported column widths. Use auto to size from exported content, grid to use the current grid width, a number for a width in points, or a callback for per-column control. Widths are proportionally reduced when their total exceeds the printable page width. By default, current grid widths are used except for the Row Numbers column, which is sized from its exported content.
|
Whether table cell text should wrap onto multiple lines. This can be overridden for individual rows or cells with PdfCellStyle.wrapText. |
Default distance between text baselines in points. |
Default maximum number of rendered text lines.
|
Default policy for text exceeding width, height or line limits. |
Horizontal indentation in points for each row-group level. |
Height of body rows in points. If omitted, calculated from font size and padding.
|
Height of header rows in points. If omitted, calculated from header font size and padding.
|
Set to false to avoid repeating header rows on each page. |
Set to false to skip drawing cell borders. |
Content to put at the top of the exported sheet.
|
Content to put at the bottom of the exported sheet.
|
A callback function to return content to be inserted below a row in the export. |
Set to true to allow the contents of the Row Numbers column to be exported.
|
String to use as the file name or a function that returns a string. |
The mimeType of the PDF file. |
If true, all columns will be exported in the order they appear in the columnDefs. When false only the columns currently being displayed will be exported. |
Provide a list (an array) of column keys or Column objects if you want to export specific columns.
|
Row node positions. |
Determines whether rows are exported before being filtered and sorted. |
Export only selected rows. |
Only export selected rows including other pages (only makes sense when using pagination). |
Set to true to exclude header column groups. |
Set to true if you don't want to export column headers. |
Set to true to skip row group headers if grouping rows. Only relevant when grouping rows. |
Set to true to suppress exporting rows pinned to the top of the grid. |
Set to true to suppress exporting rows pinned to the bottom of the grid. |
Set to true to omit the body copies of manually pinned rows. The rows in the pinned sections are still exported unless skipPinnedTop or skipPinnedBottom is enabled. |
The base source to use for getting cell values. 'data': values from the underlying row data 'batch': pending batch edit values (falls back to data if not in batch mode) 'edit': current editor values including live typing |
Apply the Show Values As transform (e.g. a percentage of a total) on top of the valueFrom base, so the export carries the displayed value for columns with an active mode. Columns without one export the base value. |
A callback function that will be invoked once per row in the grid. Return true to omit the row from the export.
|
A callback function invoked once per cell in the grid. Return a string value to be displayed in the export. For example this is useful for formatting date values.
|
A callback function invoked once per column. Return a string to be displayed in the column header.
|
A callback function invoked once per column group. Return a string to be displayed in the column group header. Note that column groups are exported by default, this option will not work with skipColumnGroupHeaders=true.
|
A callback function invoked once per row group. Return a string to be displayed in the group cell.
|
PdfColors Copy Link
Properties available on the PdfColors interface.
Background colour for the PDF page. Defaults to the theme backgroundColor.
|
Background colour for body rows. Defaults to the theme dataBackgroundColor.
|
Alternate background colour for odd body rows. Defaults to the theme oddRowBackgroundColor.
|
Text colour for body rows. Defaults to the theme foregroundColor.
|
Background colour for header rows. Defaults to the theme headerBackgroundColor.
|
Text colour for header rows. Defaults to the theme headerTextColor.
|
Border colour for cell outlines. Defaults to the theme borderColor.
|
PdfCellStyle Copy Link
Properties available on the PdfCellStyle interface.
Font size in points.
|
Font family.
|
Font weight. When omitted, the weight from the resolved font family is preserved.
|
Text colour.
|
Background colour.
|
Border colour.
|
Border width in points. Defaults to 1 when borderColor is set, otherwise 0.
|
Padding inside the cell in points. A number applies to all sides.
|
Horizontal alignment for the cell text.
|
Whether text should wrap onto multiple lines. Wrapped content increases the row height as required.
|
Whether explicit line breaks should be preserved. |
Whether repeated, leading and trailing spaces should be preserved when text wraps. |
Distance between text baselines in points. |
Maximum number of rendered text lines.
|
How text exceeding the available width, height or line limit is indicated. |
PdfDocumentTitleStyle Copy Link
Properties available on the PdfDocumentTitleStyle interface.
Margin around the document title in points. A number applies to all sides.
|
Font size in points.
|
Font family.
|
Font weight. When omitted, the weight from the resolved font family is preserved.
|
Text colour.
|
Background colour.
|
Border colour.
|
Border width in points. Defaults to 1 when borderColor is set, otherwise 0.
|
Padding inside the cell in points. A number applies to all sides.
|
Horizontal alignment for the cell text.
|
Whether text should wrap onto multiple lines. Wrapped content increases the row height as required.
|
Whether explicit line breaks should be preserved. |
Whether repeated, leading and trailing spaces should be preserved when text wraps. |
Distance between text baselines in points. |
Maximum number of rendered text lines.
|
How text exceeding the available width, height or line limit is indicated. |
PdfPageSetup Copy Link
Properties available on the PdfPageSetup interface.
The size of the PDF page. |
Page orientation. |
Page margins in points. A number applies to all sides. |
PdfCell Copy Link
Properties available on the PdfCell interface.
The data that will be added to the cell. |
The number of cells to span across (1 means span 2 columns). |
Optional styling for the cell.
|
PdfCellData Copy Link
Properties available on the PdfCellData interface.
The value of the cell. |
External URI opened when the exported cell text is selected. |
PdfRowStyleCallbackParams Copy Link
Properties available on the PdfRowStyleCallbackParams<TData = any, TContext = any> interface.
The exported element type currently being styled. |
The row node for the exported row. |
1-based index of the current exported row.
|
The current value for the exported element.
|
The grid api. |
Application context as set on gridOptions.context. |
PdfCellStyleCallbackParams Copy Link
Properties available on the PdfCellStyleCallbackParams<TData = any, TContext = any> interface.
The exported element type currently being styled. |
The row node for the exported cell. |
The current column. |
1-based index of the current exported row.
|
The current value for the exported element.
|
The grid api. |
Application context as set on gridOptions.context. |
PdfCellHyperlinkCallbackParams Copy Link
Properties available on the PdfCellHyperlinkCallbackParams<TData = any, TContext = any> interface.
The final text exported for the cell. |
The 1-based index of the current exported row. |
The row node for the exported cell. |
The current column. |
The grid api. |
Application context as set on gridOptions.context. |
PdfHeaderStyleCallbackParams Copy Link
Properties available on the PdfHeaderStyleCallbackParams<TData = any, TContext = any> interface.
The exported element type currently being styled. |
The current column. |
1-based index of the current exported row.
|
The current value for the exported element.
|
The grid api. |
Application context as set on gridOptions.context. |
PdfGroupHeaderStyleCallbackParams Copy Link
Properties available on the PdfGroupHeaderStyleCallbackParams<TData = any, TContext = any> interface.
The exported element type currently being styled. |
The current column group. |
1-based index of the current exported row.
|
The current value for the exported element.
|
The grid api. |
Application context as set on gridOptions.context. |
ColumnWidthCallbackParams Copy Link
Properties available on the ColumnWidthCallbackParams interface.
Column | null |
number |
PdfMargin Copy Link
Properties available on the PdfMargin interface.
Top margin in points. |
Right margin in points. |
Bottom margin in points. |
Left margin in points. |
Types Copy Link
PdfCustomContent Copy Link
type PdfCustomContent = PdfCell[][] | string PdfPageOrientation Copy Link
type PdfPageOrientation =
'portrait'
| 'landscape' PdfPageSize Copy Link
type PdfPageSize =
'A4'
| 'Letter'
| { width: number; height: number; } PdfFontFamily Copy Link
type PdfFontFamily =
'Helvetica'
| 'Helvetica-Bold'
| 'Times-Roman'
| 'Times-Bold'
| 'Courier'
| 'Courier-Bold' PdfTextAlignment Copy Link
type PdfTextAlignment =
'left'
| 'center'
| 'right' PdfFontWeight Copy Link
type PdfFontWeight = 'normal' | 'bold' PdfTextOverflow Copy Link
type PdfTextOverflow = 'clip' | 'ellipsis' PdfColumnWidth Copy Link
type PdfColumnWidth =
number
| 'auto'
| 'grid' PdfColumnWidthCallback Copy Link
type PdfColumnWidthCallback =
(params: ColumnWidthCallbackParams) => PdfColumnWidth
| null
| undefined PdfStyleCallbackParams Copy Link
type PdfStyleCallbackParams =
PdfRowStyleCallbackParams<TData, TContext>
| PdfCellStyleCallbackParams<TData, TContext>
| PdfHeaderStyleCallbackParams<TData, TContext>
| PdfGroupHeaderStyleCallbackParams<TData, TContext> PdfStyleCallbackType Copy Link
type PdfStyleCallbackType =
'cell'
| 'row'
| 'rowgroup'
| 'header'
| 'groupheader'