[英]Need help getting jspdf to render html to PDF
我想让jspdf工作。 点击我小提琴中的按钮后什么也没发生。 这是jsfiddle ( https://jsfiddle.net/light22/68h81owf/ )。 在此先感谢您的帮助。
这是我正在使用的脚本:
<script>
function demoFromHTML() {
var pdf = new jsPDF('p', 'pt', 'letter');
source = $('#for_pdf')[0];
specialElementHandlers = {
'#bypassme': function (element, renderer) {
return true
}
};
margins = {
top: 80,
bottom: 60,
left: 40,
width: 522
};
pdf.fromHTML(
source,
margins.left,
margins.top, {
'width': margins.width,
'elementHandlers': specialElementHandlers
},
function (dispose) {
pdf.save('download.pdf');
}, margins
);
}
</script>
单击jsfiddle中的按钮后,将引发错误: ReferenceError: demoFromHTML is not defined
。 您还忘记关闭<table>
的style属性
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.