KnpLabs / snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage

Home Page:https://knplabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use Image.php?

uponup opened this issue · comments

$snappy = new Image('/usr/local/bin/wkhtmltopdf'); $snappy->generateFromHtml($html, 'test.jpg', [], true);
There is error encounted:

Fatal error: Uncaught RuntimeException: The exit status code '1' says something went wrong:
stderr: "Unknown long argument --format

Name:
wkhtmltopdf 0.12.6 (with patched qt)

Synopsis:
wkhtmltopdf [GLOBAL OPTION]... [OBJECT]...

SOS

Hello,
I think that the problem is that you are using the wrong binary. Please try with /usr/local/bin/wkhtmltoimage.