<!DOCTYPE
html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello world</title>
</head>
<body>
<h1>Hello world</h1>
<script type="text/
JAVAscript" src="jspdf.debug.js"></script>
<script type="text/
JavaScript">
// https://www.sitepoint.com/generating-pdfs-from-web-pages-on-the-fly-with-jspdf/
var pdf = new jsPDF();
pdf.text(30, 30, 'Hello world!');
pdf.text(40, 40, 'Another line!');
pdf.save('hello_world.pdf');
</script>
</body>
</html>
将后缀重命名成.js
[jspdf.debug.pdf](https://github.com/i042416/KnowlegeRepository/files/967487/jspdf.debug.pdf)
pdf.js下载: