How do I create easily a PDF from an SVG with jsPDF?

前端 未结 5 1389
逝去的感伤
逝去的感伤 2020-12-05 16:21

I\'m trying to create a pdf but I have some SVG pictures. I found information about this problem, but I just have to use JavaScript, that\'s to say, no jQuery.

I fou

5条回答
  •  爱一瞬间的悲伤
    2020-12-05 16:43

    There now is svg2pdf.js which uses a fork of jsPDF. It has been created to solve this exact task: Exporting an SVG to a PDF.

    Also in the meantime, jsPDF also added a demo that shows how to possibly export SVG using canvg and the jsPDF canvas implementation.

    The two solutions have different advantages and disadvantages, so you might want to try both and see if one of them suits your needs.

提交回复
热议问题