-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.html
53 lines (36 loc) · 1.27 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="en">
<head>
<title>How transform HTML into Multipage PDF</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="./css/style.css" rel="stylesheet">
</head>
<body>
<div class="tips">
正在生成PDF中。。。
</div>
<div class="container">
<div id="content">
<img src="./img/1.jpg">
<img src="./img/2.jpg">
<img src="./img/3.jpg">
</div>
</div>
<div id="btn"><img src="./img/pdf.png">导出PDF</div>
<script src="./js/jspdf.debug.js"></script>
<script src="./js/html2canvas.js"></script>
<script src="./renderPDF.js"></script>
<script>
document.body.onload = function(){
document.getElementById("btn").onclick = function(e){
var tips = document.getElementsByClassName("tips")[0];
tips.id = "active";
renderPDF(document.getElementById("content"),"content","a4", function(){
tips.id = "";
});
}
}
</script>
</body>
</html>