我需要同时打印html内容和文本,我尝试使用以下代码,但是添加的文本未打印在PDF中。它仅打印html内容。请帮助我解决这个问题。
pdf = new jsPDF('l', 'mm', 'ledger'),
specialElementHandlers = {
'#editor': function( element, renderer ) {
return true;
}
};
pdf.fromHTML(
$('#customers').get(0) // HTML element
, 15 // x coord
, 0.5 // y coord
, {
'width': 3000 // was 7.5, max width of content on PDF
, elementHandlers: specialElementHandlers
}
);
pdf.text(35, 25, "test");
pdf.save( filename );
});
我认为您在这里缺少语法pdf.text(35,25,“ test”); 而是使用以下格式:pdf.text(“ test”,35,25); (在pdf文档中,其中35代表X轴,而25代表Y轴)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句