PdfExportGanttProps

Properties that you can pass as a parameter to the exportGantt(options) method from the pdfExporter module.

import { PdfExportGanttProps } from "devextreme/pdf_exporter"

component

A Gantt instance. This setting is required.

Type:

Gantt

Default Value: undefined

Refer to the pdfExporter.exportGantt(options) topic to see an example.

createDocumentMethod

A function that creates a PDF document.

Type:

Function

Function parameters:
options:

Object

PDF document settings.

Return Value:

Object

The PDF document.

Refer to the pdfExporter.exportGantt(options) topic to see an example.

dateRange

Specifies the date range for which to export tasks.

Type:

String

|

Object

Accepted Values: 'all' | 'visible'

The dateRange property accepts the following values:

  • 'all' or 'visible' to export only visible or entire Gantt data

    dateRange: 'visible'
  • A range of task indexes

    dateRange: {
        startIndex: 0,
        endIndex: 5
    }
  • A range of Date values

    dateRange: {
        startDate: new Date(2020, 0, 1),
        endDate: new Date(2020, 1, 1)
    }

Refer to the pdfExporter.exportGantt(options) topic to see an example.

exportMode

Specifies which part of the component to export (chart area, tree list area, or the entire component).

Type:

String

Default Value: 'all'
Accepted Values: 'all' | 'treeList' | 'chart'

Refer to the pdfExporter.exportGantt(options) topic to see an example.

fileName

Specifies the file name.

Type:

String

Default Value: undefined

Gantt exports its data to a PDF file with the specified name. If the fileName property is not specified, Gantt creates a PDF document with data in memory.

font

Specifies the font.

Specify the font property in the exportGantt method to use a custom font in the exported Gantt data. The fontObject and name properties are required.

JavaScript
Roboto-BoldItalic.js
DevExpress.pdfExporter.exportGantt(
  {
    component: ganttInstance,
    createDocumentMethod: (args) => new jsPDF(args),
    font: {
        fontObject: myfont,
        name: 'Roboto-BoldItalic',
    }
  },
).then((doc) => {
  doc.save('gantt.pdf');
});
// ===== or when using modules =====
import { exportGantt as exportGanttToPdf } from 'devextreme/pdf_exporter';
exportGanttToPdf(
  {
    component: ganttInstance,
    createDocumentMethod: (args) => new jsPDF(args),
    font: {
        fontObject: myfont,
        name: 'Roboto-BoldItalic',
    }
  },
).then((doc) => doc.save('gantt.pdf'));
var myfont = 'AAEAAAAS...';

format

Specifies the document size.

Type:

String

|

Object

Default Value: undefined

The format property accepts the following formats:

  • Standard document sizes from A0 to A10

    format: 'a4'
  • Custom document width and height

    format: {
        width: 210,
        height: 300
    }
  • Auto (Gantt adjusts document size to the exported data)

    format: 'auto'

Refer to the pdfExporter.exportGantt(options) topic to see an example.

jsPDFDocument

A jsPDF instance. This setting is required.

Type:

Object

Default Value: undefined

landscape

Specifies whether to use horizontal orientation for the document.

Type:

Boolean

Default Value: true

Refer to the pdfExporter.exportGantt(options) topic to see an example.

margins

Specifies the outer indents of the exported area.

Type:

Object

Default Value: undefined