How to export to PDF in React


#1

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.


#2

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:
https://files.dhtmlx.com/30d/9f1198f54ba3138e66a6877e35d7366e/react+export_7.0.1.zip
To see how it works, you need to copy the api.js from src to node_modules/dhtmlx-gantt/codebase/