-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsample.html
More file actions
106 lines (94 loc) · 2.95 KB
/
sample.html
File metadata and controls
106 lines (94 loc) · 2.95 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!doctype html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link href="https://cdn.rawgit.com/assertchris/uploads/master/prism.css" rel="stylesheet">
<style type="text/css">
@page {
margin: 0.25in 0.5in;
}
body {
font-family: "Open Sans", sans-serif;
line-height: 1.5;
color: #333;
}
table {
width: 100%;
}
th, td {
border-collapse: collapse;
padding: 10px;
}
.right {
text-align: right;
}
.center {
text-align: center;
}
h2 {
margin-top: 2em;
clear: both;
}
.next-page {
page-break-before: always;
}
</style>
</head>
<body>
<h1>Paper</h1>
<p>Hassle-free HTML to PDF conversion abstraction library.</p>
<h2>Installation</h2>
<pre><code class="language-bash">composer require asyncphp/paper</code></pre>
<h2>Usage</h2>
<pre><code class="language-php">// async
$async = new DomDriver();
$result = yield $async
->html($sample)
->size("B5")
->orientation("landscape")
->dpi(300)
->render();
// sync
$sync = new SyncDriver(new DomDriver());
$result = $sync
->html($sample)
->size("B5")
->orientation("landscape")
->dpi(300)
->render();</code></pre>
<h2 class="next-page">Supported drivers</h2>
<table>
<tr>
<th></th>
<th><a href="http://dompdf.github.io">dompdf</a></th>
<th><a href="http://wkhtmltopdf.org">wkhtmltopdf</a></th>
<th><a href="https://www.princexml.com">prince</a></th>
</tr>
<tr>
<td class="right">Requires command-line utilities</td>
<td class="center">no</td>
<td class="center">yes</td>
<td class="center">yes</td>
</tr>
<tr>
<td class="right">Supports modern CSS</td>
<td class="center">no</td>
<td class="center">yes</td>
<td class="center">yes</td>
</tr>
<tr>
<td class="right">Supports modern JS</td>
<td class="center">no</td>
<td class="center">yes</td>
<td class="center">yes</td>
</tr>
<tr>
<td class="right">Produces vector files</td>
<td class="center">yes</td>
<td class="center">yes</td>
<td class="center">yes</td>
</tr>
</table>
<script src="https://cdn.rawgit.com/assertchris/uploads/master/prism.js"></script>
</body>
</html>