Black Lives Matter. Please consider donating to Black Girls Code today.

jsPDF and html2canvas failing to transfrom plotly graph to pdf

If I target the whole document.body as DOM to transform to image and from image to pdf, I will end up with a pdf showing everything except the plotly svg. If I only target the plotly div(svg holding the graph) the resulting pdf is empty…anyone knows what is failing?

Any help appreciated!

First converting your plotly.js graph to an svg dataURI using Plotly.toImage (see example) and then piping it to jsPDF would probably lead to better results.