admin管理员组文章数量:1389762
how to add margin-bottom and top at multiple pages pdf .
although i am using the latest version of jspdf which uses .html function
let doc = new jsPDF('p', 'pt', 'a4');
let myImage = '../../../assets/logo.png';
var margins = {
top: 40,
bottom: 60,
left: 40,
width: 522
};
doc.html(document.getElementById('htmlData'), {
callback: function (pdf) {
pdf.output('dataurlnewwindow');
},
});
thank you for help
how to add margin-bottom and top at multiple pages pdf .
although i am using the latest version of jspdf which uses .html function
let doc = new jsPDF('p', 'pt', 'a4');
let myImage = '../../../assets/logo.png';
var margins = {
top: 40,
bottom: 60,
left: 40,
width: 522
};
doc.html(document.getElementById('htmlData'), {
callback: function (pdf) {
pdf.output('dataurlnewwindow');
},
});
thank you for help
Share Improve this question asked Jan 19, 2021 at 8:34 Service informatiqueService informatique 111 gold badge1 silver badge2 bronze badges1 Answer
Reset to default 3I think you forgot to add the margins variable into the .html()
I added it as an array below.
let doc = new jsPDF('p', 'pt', 'a4');
let myImage = '../../../assets/logo.png';
doc.html(document.getElementById('htmlData'), {
// Adjust your margins here (left, top, right ,bottom)
margin: [40, 60, 40, 60],
callback: function (pdf) {
pdf.output('dataurlnewwindow');
},
});
本文标签: javascriptHow to set top and bottom margin in HTML using jspdfStack Overflow
版权声明:本文标题:javascript - How to set top and bottom margin in .HTML using jspdf - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744685316a2619663.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论