PdfExportSettings

Configures the behavior and appearance of the PDF export operation. Defines which data to export, file name, styling, and callbacks for customization. Used as the configuration argument for the pdfExport method.

Props

The following table outlines the props for the PdfExportSettings:

NameTypeDefaultDescription
columns
Partial<ColumnProps>[]
undefined

Defines columns to be customized for PDF export. Overrides grid column properties for PDF generation including width, textAlign, headerText. Columns are matched by field name and merged with grid column definitions. Properties specified here take precedence over grid column properties.

customRange
undefined

Defines the custom row range when range is set to Custom. Specifies zero-based, inclusive startRow and endRow indices.

fileName
string
'Grid.pdf'

File name for the exported PDF document. Determines the name used when the browser downloads the PDF file.

footer
undefined

Footer configuration for each page of the exported PDF. Use a PdfFooter object to define bottom margin, height, and content items.

header
undefined

Header configuration for each page of the exported PDF. Use a PdfHeader object to define top margin, height, and multiple content items.

isBlob
boolean
false

Export mode for the generated PDF file. When false or not provided, the file is downloaded automatically. When true, the generated Blob is returned for custom handling (e.g., upload, in-memory processing).

maxRowsWarningThreshold
number
undefined (no limit)

Maximum number of rows allowed before a warning is triggered. Prevents export of extremely large datasets that could generate very large PDF files. When the data length exceeds this threshold, the export operation throws an error.

onAfterPdfExport
(event: PdfExportAfterEvent) => void
undefined

Callback function triggered after the PDF export operation completes or fails. Provides information about the outcome and applied settings for post-export actions.

onBeforePdfExport
(event: PdfExportBeforeEvent<T>) => void
undefined

Callback function triggered before the PDF export operation begins. Provides access to columns, data, and configuration for customization or cancellation. Allows modification of columns, data, or config prior to export.

onPdfCellCustomize
(event: PdfCellCustomizeArgs<T>) => void
undefined

Callback function triggered for each cell during PDF generation. Enables cell-level customization. Typical uses:

  • Add images to specific columns (e.g., product photos, employee pictures)
  • Add hyperlinks to cells (e.g., email addresses, URLs)
  • Format cell values using valueAccessor logic (e.g., currency, dates)
  • Apply conditional styling (e.g., red for negative values, bold for high priority)
  • Override cell display values based on data context
pageSize
string
'A4'

Page size for the PDF document (e.g., A4, Letter, Legal). Determines the physical dimensions of each PDF page.

range
'All'

Specifies which rows to include in the PDF export. Determines the data range sent to PDF generation. Available options:

  • All - Exports all rows from the data source.
  • CurrentPage - Exports only rows visible on the current page.
  • Custom - Exports rows within the range defined by customRange property.
theme
string
'Material'

Theme to apply to the PDF styling. Defines colors, fonts, and overall appearance of the exported PDF.