PDF Export includes rows after the grid's filtering and sorting by default. Export parameters can select rows, use the unprocessed row order, exclude pinned rows, or choose rows programmatically.
Export Selected Rows Copy Link
Set onlySelected=true to export selected rows instead of every row in the current export set.
api.exportDataAsPdf({
onlySelected: true,
});When using pagination, set onlySelectedAllPages=true to include selected rows from every page.
Text Wrapping And Row Height Copy Link
Cells, including numeric cells, remain on one line by default. Set wrapText=true for all exported cells, use colDef.wrapText or colDef.wrapHeaderText, or return wrapText: true from processStyleCallback for an individual PDF element.
PDF Export also translates CSS white-space properties returned by cellStyle. For example, white-space: normal enables wrapping, white-space-collapse: preserve-breaks preserves explicit line breaks without wrapping, and white-space: pre-line enables both behaviours. The pre, pre-wrap, and break-spaces values also preserve repeated, leading, and trailing spaces. The equivalent PDF-specific properties are preserveLineBreaks and preserveSpaces.
Wrapped text breaks on whitespace and falls back to character-level wrapping for words wider than the cell. Explicit newline characters start distinct lines when wrapping is enabled. lineHeight defaults to the resolved font size, maxLines is unlimited by default, and overflow defaults to 'ellipsis'.
When rowHeight is omitted, each row grows to its tallest cell. An automatically sized row that is taller than the printable area continues across pages, with its backgrounds and borders repeated for each fragment. An explicit rowHeight or headerRowHeight is a fixed clipping boundary and does not grow or continue onto another page. Use maxLines when a line-count limit is preferable to a fixed height.
Export All Unprocessed Rows Copy Link
The default exportedRows='filteredAndSorted' exports rows after filtering and sorting, in their displayed order. Set exportedRows='all' to ignore filtering and sorting and export rows in their original order.
api.exportDataAsPdf({
exportedRows: 'all',
});exportedRows='all' controls which rows form the export set. Options such as onlySelected and shouldRowBeSkipped can still remove rows from that set.
Row Groups Copy Link
Row-group labels are indented according to their displayed depth. Use rowGroupIndentSize to configure the indentation in points; processRowGroupCallback changes the exported label independently.
Set skipRowGroups=true to omit row-group rows from the export.
Pinned Rows Copy Link
Pinned top and bottom rows are exported by default. Set skipPinnedTop or skipPinnedBottom to omit the corresponding pinned section.
Manually pinned rows also remain in the exported body by default. Set skipPinnedRowDuplicates=true to omit those body copies while retaining the rows in their pinned sections.
api.exportDataAsPdf({
skipPinnedTop: true,
skipPinnedBottom: false,
skipPinnedRowDuplicates: true,
});The example below demonstrates wrapped rows, group indentation, line limits, and pinned-row sections.
Choose Rows Programmatically Copy Link
Use rowPositions to export explicit row positions, or shouldRowBeSkipped to decide whether each row in the export set should be omitted.
api.exportDataAsPdf({
shouldRowBeSkipped: ({ node }) => node.data?.status === 'Archived',
});The example below combines selected-row export, processed or unprocessed row order, and pinned-row controls.