使用html2pdf将vue.js html转换为pdf。在这里一切都很好,我只需要在分页符元素之后添加padding-top和padding-bottom。
这是我尝试过的代码。
var element = document.getElementById('inner');
var opt = {
margin: 0,
filename: this.auth_user,
image: {type: 'jpeg',quality: 0.98},
html2canvas: {
scale: 2,
bottom: 20
},
pagebreak: { mode: ['css']},
jsPDF: {
unit: 'mm',
orientation: 'portrait'
}
};
html2pdf().set(opt).from(element).then(function() {
$("#inner").css( { "font-size":"12px", "background-color" : "#F5F5F5" });
}).save();
这里需要填充
以下是示例
这将挽救我的生活