jQuery/JS Common - Object Structures - PdfExportGanttProps
Properties that you can pass as a parameter to the exportGantt(options) method from the pdfExporter module.
component
A Gantt instance. This setting is required.
Refer to the pdfExporter.exportGantt(options) topic to see an example.
createDocumentMethod
A function that creates a PDF document.
PDF document settings.
The PDF document.
Refer to the pdfExporter.exportGantt(options) topic to see an example.
dateRange
Specifies the date range for which to export tasks.
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) }
Note that the startDate
and endDate
properties do not filter Gantt tasks. For example, the exported Gantt chart displays rows even if their tasks are invisible within the specified date range.
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).
Refer to the pdfExporter.exportGantt(options) topic to see an example.
fileName
Specifies the file name.
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.
jQuery
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...';
Angular
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...';
Vue
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...';
React
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.
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.
landscape
Specifies whether to use horizontal orientation for the document.
Refer to the pdfExporter.exportGantt(options) topic to see an example.
If you have technical questions, please create a support ticket in the DevExpress Support Center.