Skip to content

Instantly share code, notes, and snippets.

@webolizzer
Created October 18, 2016 17:56
Show Gist options
  • Save webolizzer/30f78d5650048690b63a3787ac033788 to your computer and use it in GitHub Desktop.
Save webolizzer/30f78d5650048690b63a3787ac033788 to your computer and use it in GitHub Desktop.
simple PHP wrapper around wkhtmltopdf
<?php
/**
* @version 0.1
* @author github.com/webolizzer
* If you find it useful, you can buy me a coffee and a Kit-Kat @ paypal.me/webolizzer
* Thank you! :)
*/
class pdfGenerator {
/**
*
* @version 0.1
* @author github.com/webolizzer
* If you find it useful, you can buy me a coffee and a Kit-Kat @ paypal.me/webolizzer
* Thank you! :)
*/
public function save($optinons) {
$file = $optinons['file'];
$path = $optinons['path'];
return exec("wkhtmltopdf $file $path");
}
/**
* Test installation
*
* @version 0.1
* @author github.com/webolizzer
*/
public function test() {
return exec("wkhtmltopdf -V");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment