1

How do I install wkhtmltopdf with the PHP bindings on Linux (centos 5+)?

My question is slightly different to the other questions because I need help setting up the php bindings as well.

Thanks

Jason

Jason
  • 15,064
  • 15
  • 65
  • 105
  • Not a programming question. belongs on serverfault. – Ben Rowe Apr 12 '11 at 04:22
  • oh yeh, how does one migrate it – Jason Apr 12 '11 at 04:27
  • `wkhtmltopdf` is a single binary and really not difficult to invoke. Which bindings please and why would you want it? If you are referring to http://code.google.com/p/wkhtmltopdf/wiki/IntegrationWithPhp than that's a single php script too, easy to upload, hardly an issue. – mario Apr 12 '11 at 04:29
  • i was talking about this one: https://github.com/mreiferson/php-wkhtmltox but your link looks nice and easy. will use that instead. Thanks @mario. post an answer to this question with that and i will accept it. – Jason Apr 12 '11 at 04:32

1 Answers1

2

Here is a simpler method to programmatically invoke wkhtmltopdf:
http://code.google.com/p/wkhtmltopdf/wiki/IntegrationWithPhp

PHP bindings are really overkill for this applicaiton. In the majority of cases you can get away with just executing it:

exec("wkhtmltopdf http://example.org/ pdf1.pdf");
$pdf = file_get_contents("pdf1.pdf");
mario
  • 144,265
  • 20
  • 237
  • 291