jsPDF
jsPDF copied to clipboard
I am trying to convert HTML with amcharts 3 graph into PDF.
I have multiple charts using amChart3 and try to conver them into PDF like following.
const { jsPDF } = window.jspdf;
const doc = new jsPDF('l', 'pt', 'a4', false);
doc.html(document.body, {
callback: function (doc) {
doc.save();
},
x: 10,
y:
});
But, I am getting multiple errors like these.
Error loading svg
This page contains the following errors:
error on line 1 at column 167: AttValue: ' expected
Below is a rendering of the page up to the first error.
jsPDF dose not support charts?
here is jsfiddle https://jsfiddle.net/masaos/w5rv07bt/2/
The heavy-lifting of the html method is done by html2canvas. I assume html2canvas simply does not support SVG.
Since the chart is mostly SVG, you might try the svg2pdf plugin.
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.