Objects of this class are used to configure the PDF exporting process.

IgxPdfExporterOptions

new IgxPdfExporterOptions(fileName: string): IgxPdfExporterOptions

Defined in projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter-options.ts:113

Returns IgxPdfExporterOptions

Inherited from: IgxExporterOptionsBase

Specifies whether the headers should be exported if there is no data.

let alwaysExportHeaders = this.exportOptions.alwaysExportHeaders;
this.exportOptions.alwaysExportHeaders = false;
alwaysExportHeaders: boolean = true

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:101

Optional customFont

Section titled "customFont"

Custom font configuration for Unicode character support in PDF exports.

By default, the PDF exporter uses the built-in Helvetica font, which only supports basic Latin characters. If your data contains non-Latin characters (such as Cyrillic, Chinese, Japanese, Arabic, Hebrew, or special symbols), you must provide a custom TrueType font (TTF) that includes the required character glyphs.

The font data must be provided as a Base64-encoded string of the TTF file contents. You can optionally provide a separate bold variant for header styling.

customFont: PdfUnicodeFont

Defined in projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter-options.ts:111

Remarks

To convert a TTF file to Base64, you can use Node.js:

const fs = require('fs');
const fontData = fs.readFileSync('path/to/font.ttf');
const base64 = fontData.toString('base64');
fs.writeFileSync('font-base64.ts', `export const MY_FONT = '${base64}';`);

Or use an online Base64 encoder tool to convert your TTF file.

Example

Basic usage with a single font (used for both normal and bold text):

import { NOTO_SANS_REGULAR } from './fonts/noto-sans';

const options = new IgxPdfExporterOptions('Export');
options.customFont = {
    name: 'NotoSans',
    data: NOTO_SANS_REGULAR
};
this.pdfExporter.export(this.grid, options);

Inherited from: IgxExporterOptionsBase

Specifies whether the exported data should include column summaries.

let exportSummaries = this.exportOptions.exportSummaries;
this.exportOptions.exportSummaries = true;
exportSummaries: boolean = true

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:79

Specifies the font size for the table content. (10 by default)

let fontSize = this.exportOptions.fontSize;
this.exportOptions.fontSize = 12;
fontSize: number = 10

Defined in projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter-options.ts:49

Inherited from: IgxExporterOptionsBase

Specifies whether the exported data should have frozen headers.

let freezeHeaders = this.exportOptions.freezeHeaders;
this.exportOptions.freezeHeaders = true;
freezeHeaders: boolean = false

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:90

Inherited from: IgxExporterOptionsBase

Specifies if the exporter should ignore the current column order in the IgxGrid.

let ignoreColumnsOrder = this.exportOptions.ignoreColumnsOrder;
this.exportOptions.ignoreColumnsOrder = true;
ignoreColumnsOrder: boolean = false

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:33

Inherited from: IgxExporterOptionsBase

Specifies whether hidden columns should be exported.

let ignoreColumnsVisibility = this.exportOptions.ignoreColumnsVisibility;
this.exportOptions.ignoreColumnsVisibility = true;
ignoreColumnsVisibility: boolean = false

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:11

Inherited from: IgxExporterOptionsBase

Specifies whether filtered out rows should be exported.

let ignoreFiltering = this.exportOptions.ignoreFiltering;
this.exportOptions.ignoreFiltering = true;
ignoreFiltering: boolean = false

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:22

Inherited from: IgxExporterOptionsBase

Specifies whether the exported data should be grouped as in the provided IgxGrid.

let ignoreGrouping = this.exportOptions.ignoreGrouping;
this.exportOptions.ignoreGrouping = true;
ignoreGrouping: boolean = false

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:57

Inherited from: IgxExporterOptionsBase

Specifies whether the exported data should include multi column headers as in the provided IgxGrid.

let ignoreMultiColumnHeaders = this.exportOptions.ignoreMultiColumnHeaders;
this.exportOptions.ignoreMultiColumnHeaders = true;
ignoreMultiColumnHeaders: boolean = false

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:68

Inherited from: IgxExporterOptionsBase

Specifies whether the exported data should be sorted as in the provided IgxGrid. When you export grouped data, setting ignoreSorting to true will cause the grouping to fail because it relies on the sorting of the records.

let ignoreSorting = this.exportOptions.ignoreSorting;
this.exportOptions.ignoreSorting = true;
ignoreSorting: boolean = false

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:46

Specifies the page orientation. (portrait or landscape, landscape by default)

let pageOrientation = this.exportOptions.pageOrientation;
this.exportOptions.pageOrientation = 'portrait';
pageOrientation: "portrait" | "landscape" = 'landscape'

Defined in projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter-options.ts:16

Specifies the page size. (a4, a3, letter, legal, etc., a4 by default)

let pageSize = this.exportOptions.pageSize;
this.exportOptions.pageSize = 'letter';
pageSize: string = 'a4'

Defined in projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter-options.ts:27

Specifies whether to show table borders. (True by default)

let showTableBorders = this.exportOptions.showTableBorders;
this.exportOptions.showTableBorders = false;
showTableBorders: boolean = true

Defined in projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter-options.ts:38

Inherited from: IgxExporterOptionsBase

fileName: string

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:121, projects/igniteui-angular/grids/core/src/services/exporter-common/exporter-options-base.ts:133