Angular2 - Generate pdf from HTML using jspdf

后端 未结 5 1463
梦如初夏
梦如初夏 2020-12-20 13:09

For a project I\'m working on I need to be able to generate a PDF of the page the user is currently on, for which I\'ll use jspdf. Since I have a HTML

5条回答
  •  甜味超标
    2020-12-20 13:42

    Anyone still trying to convert an Html div to a pdf can opt to use html2pdf, with a couple of lines you can do everything with ease.

    var element = document.getElementById('element-to-print');
    html2pdf(element);
    

提交回复
热议问题