Gantt export to PDF/PNG. CSS styles are not getting applied



Could you please help me to figure out why my custom URL file is not getting applied

It is served from our CDN -

I use it as described in the manual

var gantt_export_css_url = "";

headerString = '<link rel="stylesheet" href="'+gantt_export_css_url+'">';

gantt.exportToPDF({name: filename + ".pdf", header: headerString});

If I use ngrok and replace URL with CSS link pointing to my development machine - all works perfectly.

Thanks for the help.



Hello Rostyslav,
It might happen because of various reasons. Unfortunately, I don’t have an online CSS that I can edit. In my opinion, the best way is to include background: 'your colour'" to detect that the style is applied. I would suggest that it might happen because of @media print { string at the beginning of the file, as it is not applied on the web page, but it is applied in the exported file:
Please try reproducing the issue in the snippet above, after that click on the “share” button and send me the link. I will try to reproduce it locally and find what might be wrong.

Best Regards,


Ramil, Thanks for the answer.
I added background: green; to the file and prepared as you asked.

Just my thoughts.
Probably you can’t get my file on your backend when preparing pdf.


Thank you. The export server needs to access the CSS file, that’s why including local files may not work.
But using your file, I was able to find a bug. Looks like, everything works correctly if you use the standalone module, but it doesn’t work if you use the online export server.
I added that bug in the tracker and it will be fixed in the future.


We have a commercial license. Could you please provide us with local export library until this bug is fixed.


Please, contact the support team to discuss that question and mention this topic.