Skip to content

Commit

Permalink
Merge pull request #28 from mhlavac/master
Browse files Browse the repository at this point in the history
Added WKHTMLToPDF class with path to the binary to make usage even easier
  • Loading branch information
h4cc committed Jan 15, 2018
2 parents b0e27c9 + b571d4d commit 4e2ab2d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,16 @@ Also a symlink will be created in your configured bin/ folder, for example:

vendor/bin/wkhtmltopdf-i386

### Usage

You can use the path constant to easily locate the binary in the PHP codebase:

``` php
$path = \h4cc\WKHTMLToPDF\WKHTMLToPDF::PATH;
```

For realpath use following script

``` php
$realpath = realpath(\h4cc\WKHTMLToPDF\WKHTMLToPDF::PATH);
```
7 changes: 7 additions & 0 deletions WKHTMLToPDF.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
namespace h4cc\WKHTMLToPDF;

class WKHTMLToPDF
{
const PATH = __DIR__ . '/bin/wkhtmltopdf-amd64';
}
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@
"bin/wkhtmltopdf-amd64"
],
"require": {
},
"autoload": {
"psr-4": {
"h4cc\\WKHTMLToPDF\\": ""
}
}
}

0 comments on commit 4e2ab2d

Please sign in to comment.