Ich habe Probleme beim Rendern von SVG-Element zu PDF mit jspdf. Ich benutze das Plugin https://github.com/CBiX/svgToPdf.js/, um dies zu tun.Render Svg zu Pdf mit jspdf
Unten ist mein Code
// I recommend to keep the svg visible as a preview
var tmp = document.getElementById("chartContainer");
var svgDoc = tmp.getElementsByTagName("svg")[0];
var pdf = new jsPDF('p', 'pt', 'a4');
svgElementToPdf(svgDoc, pdf, {
scale: 72/96, // this is the ratio of px to pt units
removeInvalid: false // this removes elements that could not be translated to pdf from the source svg
});
pdf.output('datauri'); // use output() to get the jsPDF buffer
Es ist generarting leer pdf. Bitte helfen
svgToPdf unterstützen nur g, Linie, rect, Ellipse , Kreis, Textelemente und einige Attribute. Spielen Sie es einfach als einfache Demo. – cuixiping
@Priyesh Tiwari: Ich habe das gleiche Problem svg zu PDF-Konvertierung, wie hast du dein Problem gelöst? –