jQuery/JS Common - Object Structures - PdfExportGanttProps
Properties that you can pass as a parameter to the exportGantt(options) method from the pdfExporter module.
component
Refer to the pdfExporter.exportGantt(options) topic to see an example.
createDocumentMethod
Refer to the pdfExporter.exportGantt(options) topic to see an example.
dateRange
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.
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
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
Refer to the pdfExporter.exportGantt(options) topic to see an example.