---
product: "AG Grid"
title: "PDF Export API Reference"
description: "This page documents the PDF Export API and interfaces."
enterprise: true
framework: react
version: "36.2.0"
related:
    - title: "Styles"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-styles/"
    - title: "Languages"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-languages/"
    - title: "Extra Content"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-extra-content/"
    - title: "Customising Content"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-customising-content/"
    - title: "Images"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-images/"
    - title: "Watermarks"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-watermarks/"
    - title: "Rows"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-rows/"
    - title: "Columns"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-columns/"
    - title: "Hyperlinks"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-hyperlinks/"
    - title: "Master Detail"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-master-detail/"
    - title: "Page Setup"
      url: "https://www.ag-grid.com/react-data-grid/pdf-export-page-setup/"
llms: "https://www.ag-grid.com/llms.txt"
---

# PDF Export API Reference

This page documents the PDF Export API and interfaces.

### Grid Properties

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `defaultPdfExportParams` | `PdfExportParams` |  |  |  |
| `suppressPdfExport` | `boolean` |  |  |  |

### API Methods

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `exportDataAsPdf` | `Function` |  |  |  |
| `getDataAsPdf` | `Function` |  |  |  |

## Interfaces

### PdfCell

Properties available on the `PdfCell` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `data` | `PdfCellData` |  |  |  |
| `mergeAcross` | `number` |  |  |  |
| `style` | `PdfCellStyle` |  |  |  |

### PdfCellData

Properties available on the `PdfCellData` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `string \| null` |  |  |  |
| `hyperlink` | `string` |  |  |  |
| `image` | `PdfImage` |  |  |  |

### PdfCellHyperlinkCallbackParams

Properties available on the `PdfCellHyperlinkCallbackParams&lt;TData = any, TContext = any&gt;` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `string` |  |  |  |
| `accumulatedRowIndex` | `number` |  |  |  |
| `node` | `IRowNode` |  |  |  |
| `column` | `Column` |  |  |  |
| `api` | `GridApi` |  |  |  |
| `context` | `TContext` |  |  |  |

### PdfCellStyle

Properties available on the `PdfCellStyle` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `backgroundColor` | `string` |  |  |  |
| `borderColor` | `string` |  |  |  |
| `borderWidth` | `number` |  |  |  |
| `padding` | `number \| PdfMargin` |  |  |  |
| `alignment` | `PdfTextAlignment` |  |  |  |
| `wrapText` | `boolean` |  |  |  |
| `preserveLineBreaks` | `boolean` |  |  |  |
| `preserveSpaces` | `boolean` |  |  |  |
| `maxLines` | `number` |  |  |  |
| `overflow` | `PdfTextOverflow` |  |  |  |
| `fontSize` | `number` |  |  |  |
| `fontFamily` | `PdfFontFamily` |  |  |  |
| `fontWeight` | `PdfFontWeight` |  |  |  |
| `fontStyle` | `PdfFontStyle` |  |  |  |
| `direction` | `PdfTextDirection` |  |  |  |
| `language` | `string` |  |  |  |
| `color` | `string` |  |  |  |
| `lineHeight` | `number` |  |  |  |

### PdfCellStyleCallbackParams

Properties available on the `PdfCellStyleCallbackParams&lt;TData = any, TContext = any&gt;` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `type` | `'cell' \| 'rowgroup'` |  |  |  |
| `node` | `IRowNode \| null` |  |  |  |
| `column` | `Column` |  |  |  |
| `accumulatedRowIndex` | `number` |  |  |  |
| `value` | `any` |  |  |  |
| `api` | `GridApi` |  |  |  |
| `context` | `TContext` |  |  |  |

### PdfColors

Properties available on the `PdfColors` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `backgroundColor` | `string` |  |  |  |
| `dataBackgroundColor` | `string` |  |  |  |
| `oddRowBackgroundColor` | `string` |  |  |  |
| `foregroundColor` | `string` |  |  |  |
| `headerBackgroundColor` | `string` |  |  |  |
| `headerTextColor` | `string` |  |  |  |
| `borderColor` | `string` |  |  |  |

### PdfDocumentHeadingStyle

Properties available on the `PdfDocumentHeadingStyle` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `margin` | `number \| PdfMargin` |  |  |  |
| `backgroundColor` | `string` |  |  |  |
| `borderColor` | `string` |  |  |  |
| `borderWidth` | `number` |  |  |  |
| `padding` | `number \| PdfMargin` |  |  |  |
| `alignment` | `PdfTextAlignment` |  |  |  |
| `wrapText` | `boolean` |  |  |  |
| `preserveLineBreaks` | `boolean` |  |  |  |
| `preserveSpaces` | `boolean` |  |  |  |
| `maxLines` | `number` |  |  |  |
| `overflow` | `PdfTextOverflow` |  |  |  |
| `fontSize` | `number` |  |  |  |
| `fontFamily` | `PdfFontFamily` |  |  |  |
| `fontWeight` | `PdfFontWeight` |  |  |  |
| `fontStyle` | `PdfFontStyle` |  |  |  |
| `direction` | `PdfTextDirection` |  |  |  |
| `language` | `string` |  |  |  |
| `color` | `string` |  |  |  |
| `lineHeight` | `number` |  |  |  |

### PdfExportParams

Properties available on the `PdfExportParams` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `fonts` | `PdfFontFamilyDefinition[]` |  |  |  |
| `language` | `string` |  |  |  |
| `direction` | `PdfTextDirection` |  |  |  |
| `documentTitle` | `string` |  |  |  |
| `documentTitleStyle` | `PdfDocumentHeadingStyle` |  |  |  |
| `documentSubtitle` | `string` |  |  |  |
| `documentSubtitleStyle` | `PdfDocumentHeadingStyle` |  |  |  |
| `coverPage` | `boolean` |  |  |  |
| `headerFooterConfig` | `PdfHeaderFooterConfig` |  |  |  |
| `watermark` | `PdfWatermark` |  |  |  |
| `colors` | `PdfColors` |  |  |  |
| `skipGridStyles` | `boolean` |  |  |  |
| `processStyleCallback` | `Function` |  |  |  |
| `processCellHyperlinkCallback` | `Function` |  |  |  |
| `addImageToCell` | `Function` |  |  |  |
| `page` | `PdfPageSetup` |  |  |  |
| `defaultCellStyle` | `PdfCellStyle` |  |  |  |
| `defaultHeaderStyle` | `PdfCellStyle` |  |  |  |
| `columnWidth` | `PdfColumnWidth \| PdfColumnWidthCallback` |  |  |  |
| `rowGroupIndentSize` | `number` |  |  |  |
| `rowHeight` | `number` |  |  |  |
| `headerRowHeight` | `number` |  |  |  |
| `repeatHeader` | `boolean` |  |  |  |
| `drawCellBorders` | `boolean` |  |  |  |
| `prependContent` | `PdfCustomContent` |  |  |  |
| `appendContent` | `PdfCustomContent` |  |  |  |
| `getCustomContentBelowRow` | `Function` |  |  |  |
| `exportRowNumbers` | `boolean` |  |  |  |
| `fileName` | `string \| ExportFileNameGetter` |  |  |  |
| `mimeType` | `string` |  |  |  |
| `allColumns` | `boolean` |  |  |  |
| `columnKeys` | `(string \| Column)[]` |  |  |  |
| `rowPositions` | `RowPosition[]` |  |  |  |
| `exportedRows` | `'all' \| 'filteredAndSorted'` |  |  |  |
| `onlySelected` | `boolean` |  |  |  |
| `onlySelectedAllPages` | `boolean` |  |  |  |
| `skipColumnGroupHeaders` | `boolean` |  |  |  |
| `skipColumnHeaders` | `boolean` |  |  |  |
| `skipRowGroups` | `boolean` |  |  |  |
| `skipPinnedTop` | `boolean` |  |  |  |
| `skipPinnedBottom` | `boolean` |  |  |  |
| `skipPinnedRowDuplicates` | `boolean` |  |  |  |
| `valueFrom` | `CellValueResolveFrom` |  |  |  |
| `transformValues` | `boolean` |  |  |  |
| `shouldRowBeSkipped` | `Function` |  |  |  |
| `processCellCallback` | `Function` |  |  |  |
| `processHeaderCallback` | `Function` |  |  |  |
| `processGroupHeaderCallback` | `Function` |  |  |  |
| `processRowGroupCallback` | `Function` |  |  |  |

### PdfFontFace

Properties available on the `PdfFontFace` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `data` | `ArrayBuffer \| Uint8Array` |  |  |  |
| `weight` | `PdfFontWeight` |  |  |  |
| `style` | `PdfFontStyle` |  |  |  |

### PdfFontFamilyDefinition

Properties available on the `PdfFontFamilyDefinition` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `family` | `string` |  |  |  |
| `faces` | `PdfFontFace[]` |  |  |  |

### PdfGroupHeaderStyleCallbackParams

Properties available on the `PdfGroupHeaderStyleCallbackParams&lt;TData = any, TContext = any&gt;` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `type` | `'groupheader'` |  |  |  |
| `column` | `ColumnGroup` |  |  |  |
| `accumulatedRowIndex` | `number` |  |  |  |
| `value` | `any` |  |  |  |
| `api` | `GridApi` |  |  |  |
| `context` | `TContext` |  |  |  |

### PdfHeaderFooter

Properties available on the `PdfHeaderFooter` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `header` | `PdfHeaderFooterContent[]` |  |  |  |
| `footer` | `PdfHeaderFooterContent[]` |  |  |  |

### PdfHeaderFooterConfig

Properties available on the `PdfHeaderFooterConfig` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `all` | `PdfHeaderFooter` |  |  |  |
| `first` | `PdfHeaderFooter` |  |  |  |
| `even` | `PdfHeaderFooter` |  |  |  |

### PdfHeaderFooterImageContent

Properties available on the `PdfHeaderFooterImageContent` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `string` |  |  |  |
| `image` | `PdfImage` |  |  |  |
| `position` | `'Left' \| 'Center' \| 'Right'` |  |  |  |
| `style` | `PdfTextStyle` |  |  |  |

### PdfHeaderFooterTextContent

Properties available on the `PdfHeaderFooterTextContent` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `string` |  |  |  |
| `image` | `PdfImage` |  |  |  |
| `position` | `'Left' \| 'Center' \| 'Right'` |  |  |  |
| `style` | `PdfTextStyle` |  |  |  |

### PdfHeaderStyleCallbackParams

Properties available on the `PdfHeaderStyleCallbackParams&lt;TData = any, TContext = any&gt;` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `type` | `'header'` |  |  |  |
| `column` | `Column` |  |  |  |
| `accumulatedRowIndex` | `number` |  |  |  |
| `value` | `any` |  |  |  |
| `api` | `GridApi` |  |  |  |
| `context` | `TContext` |  |  |  |

### PdfMargin

Properties available on the `PdfMargin` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `top` | `number` |  |  |  |
| `right` | `number` |  |  |  |
| `bottom` | `number` |  |  |  |
| `left` | `number` |  |  |  |

### PdfPageSetup

Properties available on the `PdfPageSetup` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `size` | `PdfPageSize` |  |  |  |
| `orientation` | `PdfPageOrientation` |  |  |  |
| `margin` | `number \| PdfMargin` |  |  |  |

### PdfRowStyleCallbackParams

Properties available on the `PdfRowStyleCallbackParams&lt;TData = any, TContext = any&gt;` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `type` | `'row'` |  |  |  |
| `node` | `IRowNode \| null` |  |  |  |
| `accumulatedRowIndex` | `number` |  |  |  |
| `value` | `any` |  |  |  |
| `api` | `GridApi` |  |  |  |
| `context` | `TContext` |  |  |  |

### PdfTextStyle

Properties available on the `PdfTextStyle` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `fontSize` | `number` |  |  |  |
| `fontFamily` | `PdfFontFamily` |  |  |  |
| `fontWeight` | `PdfFontWeight` |  |  |  |
| `fontStyle` | `PdfFontStyle` |  |  |  |
| `direction` | `PdfTextDirection` |  |  |  |
| `language` | `string` |  |  |  |
| `color` | `string` |  |  |  |
| `lineHeight` | `number` |  |  |  |

### PdfWatermark

Properties available on the `PdfWatermark` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `text` | `string` |  |  |  |
| `opacity` | `number` |  |  |  |
| `rotation` | `number` |  |  |  |
| `pages` | `PdfWatermarkPageSelection` |  |  |  |
| `style` | `PdfTextStyle` |  |  |  |
