forked from crabbly/Print.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
45 lines (42 loc) · 1022 Bytes
/
test.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
<html>
<script src='./dist/print.min.js'></script>
<script type='text/javascript'>
function printPdf() {
printJS('/test.pdf');
}
function printHtml() {
printJS('test', 'html');
}
function printJson() {
let data = [
{
test1: 'Test1 string',
test2: {
a: 'Test2 object, a property',
}
},
{
test1: 'more Test1 string',
test2: {
a: 'more Test2 object, a property',
}
}
]
printJS({printable: data, properties: ['test1', 'test2.a'], type: 'json'})
}
</script>
<body>
<section id="test">
<h1>Print.js Test Page</h1>
<button onClick='printPdf();'>
Print PDF
</button>
<button onClick='printHtml();'>
Print HTML
</button>
<button onClick='printJson();'>
Print JSON
</button>
</section>
</body>
</html>