[英]Html to pdf Jspdf
When I'm converting my html div to pdf using Jspdf library the generated pdf is not showing the whole content of mydiv.It only shows little html but not complete div. 当我使用Jspdf库将我的html div转换为pdf时,生成的pdf没有显示mydiv的全部内容。它只显示小html而不是完整的div。 What I am missing in this ?
我在这里缺少什么?
<button id="b2">Export to pdf</button>
<script>
var doc = new jsPDF();
var specialElementHandlers = {
'#editor': function (element, renderer) {
return true;
}
};
$('#b2').click(function () {
doc.fromHTML($('#mydiv').html(), 15, 15, {
'width': 170,
'elementHandlers': specialElementHandlers
});
doc.save('sample-file.pdf');
});
</script>
Things you can do: 你可以做的事情:
#editor
for the specialElementHandlers and #mydiv
in the click function? #editor
for specialElementHandlers和#mydiv
在click函数中?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.