Export Large data set to PDF in Chrome



We are using dhtmlxGantt chart in our application. When there are around 500 tactics in web page then export to pdf is working perfect. But when number of tactics goes to 1000 it gives error like “Invalid Json data”. We looked into forums and came to know that it supports 4 MB json data. In our case size of json data is only 0.5 MB.

This is working perfect in firefox. Is there any limitation in Chrome for the same? Please confirm and provide some solution.



I’ve reproduced the issue
docs.dhtmlx.com/gantt/snippet/56a9577d - 900 tasks, all seems ok although takes a while to generate a file.
docs.dhtmlx.com/gantt/snippet/a1446053 - 1000 tasks, error - pdf can’t be opened

Seems like there is some threshold of number of elements after which pdf can not be opened. We’ll investigate why is this happening.

As a solution, you can try changing a zoom level of a time scale before exporting, in order to print a chart with a lower detalization, e.g.[code]// set lower resolution for the export
var scaleUnit = gantt.config.scale_unit;
var subscales = gantt.config.subscales;
gantt.config.scale_unit = “month”;
gantt.config.subscales = [];


// restore settings back after export is complete
gantt.config.scale_unit = scaleUnit;
gantt.config.subscales = subscales;[/code]
docs.dhtmlx.com/gantt/snippet/1e69e362 - 1000 tasks, all seems ok again.

Alternatively, you can try exporting data by parts instead of printing the whole chart at once. You can do it using “data” property of exportToPDF config object

However, I’ve never got “Invalid JSON data” so maybe your issue is caused by something else. If it’s so - please provide some kind of demo, where we could reproduce it.


Hi Aliaksandr,

Thanks a lot for your response. I have tried with the solution given by you but not able to resolve this issue. Then I have taken latest code for export gantt chart to pdf from http://export.dhtmlx.com/gantt/api.js link.

Now it is working perfect!



I faced same problem.for large task in gantt view above 1500 task its export blank pdf and png.
Please suggest me solution

Gantt chart exporting as a blank PDF

Hello Shivani,
We know about that issue, and it will be fixed in the future. Unfortunately, I don’t have a workaround, and I cannot give you any ETA, but I will notify you when the bug is fixed.



We have more than 1000 tasks in our list. when we export the pdf It only export pdf for first 500 tasks.
less than 500 tasks list working fine. we have our own server setup for exporting.

could you please suggest the solution for this.



Hello Prashant,
Starting from August-September 2020, the export module uses Electron as a rendering engine:

It is possible to export 1000 tasks with the online export server:

If you have the local export module, it shouldn’t be an issue as it can export huge charts.

You can download the newer version in the Client’s Area.
If the issue is still reproduced, please, contact the support team according to the instructions in the email with the license and provide a demo to reproduce the issue locally.