Vue imports
import * as JsPdf from 'jspdf-yworks';
import * as svg2pdf from 'svg2pdf.js';
Function
getPDF () {
console.log('getPDF');
// Get svg markup as string
let svg = document.getElementById('svg-container').innerHTML;
svg = svg.replace(/\r?\n|\r/g, '').trim();
const pdf = new JsPdf('l', 'pt', 'a4');
// render the svg element
svg2pdf(svg, pdf, {
xOffset: 0,
yOffset: 0,
scale: 1
});
// get the data URI
// const uri = pdf.output('datauristring');
// or simply safe the created pdf
pdf.save('myPDF.pdf');
},
I'm getting the following error when trying to convert an SVG object using Vue.js