Core Features

Advanced Features

JavaScript Data GridPDF Export - Extra Content

Version 36.2.0
Enterprise

PDF Export can add document headings, page headers and footers, cover pages, and content before, after, or within the exported table.

Document Headings Copy Link

Use documentTitle to set the PDF metadata title and render a visible title above the table. Use documentTitleStyle to configure its font, colour, border, padding, margin, alignment, wrapping, line height, line limit, and overflow behaviour.

Subtitle Copy Link

Use documentSubtitle to render a subtitle below the title. It uses a smaller default font and can be styled independently with documentSubtitleStyle.

const gridOptions = {
    documentTitle: 'Quarterly Results',
    documentSubtitle: 'Prepared for the board',

    // other grid options ...
}

Page Headers And Footers Copy Link

Use headerFooterConfig to add content to the left, centre, or right of each page header and footer. The all rule applies by default, while first and even replace it on the corresponding pages.

Each header or footer accepts up to three entries. When position is omitted, entries are positioned left, centre, and right in array order.

Each position uses one third of the printable page width. Header and footer text remains on one line and is truncated with an ellipsis when it exceeds that space. The required vertical space is reserved before the table is paginated.

Page Headers Copy Link

const gridOptions = {
    headerFooterConfig: {
        all: {
            header: [{ value: 'Quarterly Results', position: 'Center' }],
        },
        first: {
            header: [{ value: 'Confidential Report', position: 'Center' }],
        },
    },

    // other grid options ...
}

Page Footers Copy Link

Header and footer values support the following placeholders:

  • &[Page]: current page number.
  • &[Pages]: total number of pages.
  • &[Date]: date when the PDF export started.
  • &[Time]: time when the PDF export started.

Date and time are captured once per export and formatted using the export language, when provided.

const gridOptions = {
    headerFooterConfig: {
        all: {
            footer: [
                { value: '&[Date]', position: 'Left' },
                { value: 'Page &[Page] of &[Pages]', position: 'Center' },
                { value: '&[Time]', position: 'Right' },
            ],
        },
    },

    // other grid options ...
}

Cover Page Copy Link

Set coverPage=true to place the document title and subtitle on the first page and begin the exported grid on the following page. Page header and footer rules still apply, so headerFooterConfig.first can customise the cover page.

const gridOptions = {
    coverPage: true,
    documentTitle: 'Annual Performance Report',
    documentSubtitle: 'Financial year 2026',

    // other grid options ...
}

Additional Content Copy Link

Use prependContent, appendContent, or getCustomContentBelowRow to add content that is not displayed in the grid. Strings create full-width rows. Use PdfCell[][] for explicit spans and styling.

See PDF Export - Master Detail for an example that uses getCustomContentBelowRow to include detail data below each master row.

API Copy Link

Export Options Copy Link

documentTitleCopy Link
string
The document title stored in the PDF metadata. When set, a visible title is rendered above the exported table.
documentTitleStyleCopy Link
PdfDocumentHeadingStyle
Styling for the visible document title.
documentSubtitleCopy Link
string
A visible subtitle rendered below the document title.
documentSubtitleStyleCopy Link
PdfDocumentHeadingStyle
Styling for the visible document subtitle.
coverPageCopy Link
boolean
default: false
Set to true to render the document title and subtitle on a separate first page. The exported grid begins on the following page.
headerFooterConfigCopy Link
PdfHeaderFooterConfig
Page header and footer content.
prependContentCopy Link
PdfCustomContent
Content to put at the top of the exported sheet.
appendContentCopy Link
PdfCustomContent
Content to put at the bottom of the exported sheet.
getCustomContentBelowRowCopy Link
Function
A callback function to return content to be inserted below a row in the export.

PdfDocumentHeadingStyle Copy Link

Properties available on the PdfDocumentHeadingStyle interface.

marginCopy Link
number | PdfMargin
Margin around the document heading in points. A number applies to all sides.
backgroundColorCopy Link
string
Background colour.
borderColorCopy Link
string
Border colour.
borderWidthCopy Link
number
Border width in points. Defaults to 1 when borderColor is set, otherwise 0.
paddingCopy Link
number | PdfMargin
Padding inside the cell in points. A number applies to all sides.
alignmentCopy Link
PdfTextAlignment
Horizontal alignment for the cell text.
wrapTextCopy Link
boolean
default: false
Whether text should wrap onto multiple lines. Wrapped content increases the row height as required.
preserveLineBreaksCopy Link
boolean
default: true when wrapText is true, otherwise false
Whether explicit line breaks should be preserved.
preserveSpacesCopy Link
boolean
default: false
Whether repeated, leading and trailing spaces should be preserved when text wraps.
maxLinesCopy Link
number
Maximum number of rendered text lines.
overflowCopy Link
PdfTextOverflow
default: 'ellipsis'
How text exceeding the available width, height or line limit is indicated.
fontSizeCopy Link
number
Font size in points.
fontFamilyCopy Link
PdfFontFamily
Font family.
fontWeightCopy Link
PdfFontWeight
Font weight. When omitted, the weight from the resolved font family is preserved.
fontStyleCopy Link
PdfFontStyle
default: 'normal'
Font style.
directionCopy Link
PdfTextDirection
Text direction. auto uses the first strong directional character. When omitted, the export-level direction is used. Text direction does not change exported column order.
languageCopy Link
string
BCP 47 language tag used when selecting language-specific OpenType features. When omitted, the export-level language is used.
string
Text colour.
lineHeightCopy Link
number
Distance between text baselines in points. Defaults to the natural line height from the resolved font metrics, with a minimum of fontSize.

PdfHeaderFooterConfig Copy Link

Properties available on the PdfHeaderFooterConfig interface.

PdfHeaderFooter
Header and footer configuration applied to every page unless overridden.
PdfHeaderFooter
Header and footer configuration applied to the first page.
PdfHeaderFooter
Header and footer configuration applied to even-numbered pages.

PdfHeaderFooter Copy Link

Properties available on the PdfHeaderFooter interface.

headerCopy Link
PdfHeaderFooterContent[]
Up to three header entries positioned left, centre, and right.
PdfHeaderFooterContent[]
Up to three footer entries positioned left, centre, and right.

PdfHeaderFooterTextContent Copy Link

Properties available on the PdfHeaderFooterTextContent interface.

string
Header or footer text. Supports &[Page], &[Pages], &[Date], and &[Time] placeholders.
PdfImage
Image rendered alongside the text.
positionCopy Link
'Left' | 'Center' | 'Right'
Position of the content within the printable page width. When omitted, array entries default to left, centre, and right in order.
PdfTextStyle
Text styling for this entry.

PdfHeaderFooterImageContent Copy Link

Properties available on the PdfHeaderFooterImageContent interface.

string
Header or footer text. Supports &[Page], &[Pages], &[Date], and &[Time] placeholders.
PdfImage
Image rendered alongside the text.
positionCopy Link
'Left' | 'Center' | 'Right'
Position of the content within the printable page width. When omitted, array entries default to left, centre, and right in order.
PdfTextStyle
Text styling for this entry.

PdfTextStyle Copy Link

Properties available on the PdfTextStyle interface.

fontSizeCopy Link
number
Font size in points.
fontFamilyCopy Link
PdfFontFamily
Font family.
fontWeightCopy Link
PdfFontWeight
Font weight. When omitted, the weight from the resolved font family is preserved.
fontStyleCopy Link
PdfFontStyle
default: 'normal'
Font style.
directionCopy Link
PdfTextDirection
Text direction. auto uses the first strong directional character. When omitted, the export-level direction is used. Text direction does not change exported column order.
languageCopy Link
string
BCP 47 language tag used when selecting language-specific OpenType features. When omitted, the export-level language is used.
string
Text colour.
lineHeightCopy Link
number
Distance between text baselines in points. Defaults to the natural line height from the resolved font metrics, with a minimum of fontSize.

PdfCell Copy Link

Properties available on the PdfCell interface.

data requiredCopy Link
PdfCellData
The data that will be added to the cell.
mergeAcrossCopy Link
number
default: 0
The number of cells to span across (1 means span 2 columns).
PdfCellStyle
Optional styling for the cell.

PdfCellData Copy Link

Properties available on the PdfCellData interface.

value requiredCopy Link
string | null
The value of the cell.
string
External URI opened when the exported cell text is selected.
PdfImage
Image rendered alongside the cell value.