Search results

Pdf Export in JavaScript (ES5) Gantt control

02 Dec 2022 / 1 minute to read

PDF export allows exporting Gantt data to PDF document. You need to use the pdfExport method for exporting. To enable PDF export in the Gantt, set the allowPdfExport to true.

To export data to PDF document, inject the PdfExport module in Gantt.

Note: Currently, we don’t have support for exporting the manually scheduled tasks.

Copied to clipboard
var clickHandler = function(args){
   if ( === 'GanttExport_pdfexport') {

var ganttChart = new ej.gantt.Gantt({
    dataSource: GanttData,
    height: '450px',
    taskFields: {
        id: 'TaskID',
        name: 'TaskName',
        startDate: 'StartDate',
        duration: 'Duration',
        progress: 'Progress',
        child: 'subtasks'
    allowPdfExport: true,
    toolbar: ['PdfExport'],
    toolbarClick: clickHandler
Copied to clipboard
<!DOCTYPE html><html lang="en"><head>
    <title>EJ2 Gantt</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Typescript Gantt Controls">
    <meta name="author" content="Syncfusion">
    <link href="index.css" rel="stylesheet">
	<link href="" rel="stylesheet" type="text/css">
<script src="" type="text/javascript"></script>
<script src="es5-datasource.js" type="text/javascript"></script>

        <div id="container">
            <div id="GanttExport"></div>        

var ele = document.getElementById('container');
if(ele) { = "visible";
<script src="index.js" type="text/javascript"></script>