jsPdf add margins to pdf page
问题 I use jsPdf for creating pdf from html. How can I add margings (top, left, right) to my pdf page? var doc = new jsPDF('p', 'pt', 'letter'); doc.addHTML($('#template_invoice')[0], function () { ... }); Thanks for any help! 回答1: JSPdf allows you to make a margin hash and apply it in your download i.e. margins = { top: 40, bottom: 60, left: 40, width: 522 }; Try this snippet below or this CodePen : $(document).ready(function() { $(".btn").click(function() { var doc = new jsPDF("p", "pt", "letter