Skip to content

Commit 4e2ab2d

Browse files
authored
Merge pull request #28 from mhlavac/master
Added WKHTMLToPDF class with path to the binary to make usage even easier
2 parents b0e27c9 + b571d4d commit 4e2ab2d

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,16 @@ Also a symlink will be created in your configured bin/ folder, for example:
3434

3535
vendor/bin/wkhtmltopdf-i386
3636

37+
### Usage
38+
39+
You can use the path constant to easily locate the binary in the PHP codebase:
40+
41+
``` php
42+
$path = \h4cc\WKHTMLToPDF\WKHTMLToPDF::PATH;
43+
```
44+
45+
For realpath use following script
46+
47+
``` php
48+
$realpath = realpath(\h4cc\WKHTMLToPDF\WKHTMLToPDF::PATH);
49+
```

WKHTMLToPDF.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
namespace h4cc\WKHTMLToPDF;
3+
4+
class WKHTMLToPDF
5+
{
6+
const PATH = __DIR__ . '/bin/wkhtmltopdf-amd64';
7+
}

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@
1515
"bin/wkhtmltopdf-amd64"
1616
],
1717
"require": {
18+
},
19+
"autoload": {
20+
"psr-4": {
21+
"h4cc\\WKHTMLToPDF\\": ""
22+
}
1823
}
1924
}

0 commit comments

Comments
 (0)