How to export to PDF in React


I’m trying to export my Gantt chart to pdf in React. but the API request is not working. I don’t know how to call it. please help. Thank you in advance. it crashes with Gantt npm library.


Hello Kaveen,
There are different components: Javascript Gantt and React Gantt. Both of them have a different set of features. The latter doesn’t have the feature to export the data to PDF.

If you try using Javascript Gantt in React, you need to include the export’s api.js file or its contents to the page with the Gantt configuration.
Here is a demo:
To see how it works, you need to copy the api.js from src to node_modules/dhtmlx-gantt/codebase/