<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>HTML Test File</title>
</head>
<body>
<div style='position: absolute; left: 0; top: 0; bottom: 0; overflow: auto; width: 400px; background: #fff'>
<h1>Tdlkjg拉克丝的结果分厘卡撒酒疯了</h1>
<h1>Headings</h1>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<hr>
</div>
<script src='../js/jquery-2.1.4.min.js'></script>
<script src='../js/html2canvas.js'></script>
<script src='../js/jspdf.debug.js'></script>
<script>
var pdf = new jsPDF('p', 'pt', 'a4');
pdf.canvas.height = 72 * 11;
pdf.canvas.width = 72 * 8.5;
pdf.addHTML($('body'), function () {
var iframe = document.createElement('iframe');
iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:500px');
document.body.appendChild(iframe);
iframe.src = pdf.output('datauristring');
// // pdf.output('save','test.pdf');
// pdf.save();
});
</script>
</body>
</html>