I'm trying to export a highchart charts to a PDF file. For that, I've read that I should use exporting.js (and others libraries). But when I import this library (exporting.js) I get this error: 'Cannot read property 'document' of undefined'.
I import this from a javascript:
var newscript = document.createElement('script');
newscript.type = 'text/javascript';
newscript.async = true;
newscript.src = '/resources/tda-ga/js/charts/lib/exporting.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(newscript);
I will appreciate any help!