-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.html
More file actions
35 lines (28 loc) · 841 Bytes
/
sample.html
File metadata and controls
35 lines (28 loc) · 841 Bytes
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
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test htmlscreenshot</title>
<meta name="description" content=" Takes a complex screenshot from any HTML Element and return it as a canvas element" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="htmlscreenshot.js"></script>
<script>
function scr(){
document.body.toPNG(
function (){
document.getElementById('downloadSCR').src=document.body.dataIMG;
}
);
}
</script>
</head>
<body>
<div class="container" >
<h1>title 1</h1>
<h2>title 2</h2>
<h3>title 3</h3>
<button onclick="scr()">TAKE SCREENSHOT OF BODY</button>
<img id="downloadSCR" src="" width="400" height="400"/>
</div>
</body>
</html>