Closed shaoran closed 6 years ago
To quote the README:
Dependencies jsPDF (yWorks fork version!) fontello/svgpath
You are using the wrong jsPDF version. svg2pdf.js only works with the yWorks fork fork.
Oh, I didn't realize that. Too bad that the Highcharts documentation doesn't point out this crucial fact. I've spent a lot of time trying to make them work together. I'll try yWorks fork now.
Thanks for the replies.
I'm not sure if this a
svg2pdf.js
or ajsPDF
issue.For an application I need to export a Highcharts chart as PDF using
exportChartLocal
. When I call this method, this method eventually fails.I managed to pin point the location where the error occurs:
in
svg2pdf.js
:` // the actual svgToPdf function (see above) var svg2pdf = function (element, pdf, options) { _pdf = pdf;
} `
The problem here is that the functions
saveGraphicsState
,setCurrentTransformationMatrix
andrestoreGraphicsState
are undefined. The method which creates thepdf
object in Highcharts looks like this:I've looked in the jsPDF code, but there is no single place where any of this functions are defined in the source code.
The question is: is this an
svg2pdf.js
or anjsPDF
issue? And could it be that the versions I'm running right now are not compatible with each other?I installed them using bower (1.8.2) and these are the versions:
Should I install different versions of these packages?