mikehaertl / phpwkhtmltopdf

A slim PHP wrapper around wkhtmltopdf with an easy to use and clean OOP interface
MIT License
1.6k stars 238 forks source link

Can't add low quality to options #348

Closed JerryBels closed 4 years ago

JerryBels commented 4 years ago

Hi, and thanks for the wrapper !

I'm having trouble generating a pdf with --lowquality option. Tried :

$pdf = new Pdf(['--lowquality']);
$pdf->addPage($html);

Or :

$pdf = new Pdf($html);
$pdf->setOptions(['--lowquality']);

It fails to generate the pdf in both cases. Did I miss something about how these options should be passed?

Thanks ahead.

mikehaertl commented 4 years ago

Try without --. Also in cases like this please always provide the full (minimal) code and what error you get from getError().

JerryBels commented 4 years ago

You're right, I simply needed to let out the --. The PDF is correctly generated now - but has no difference whatsoever in file size with or without the option. getError() is now empty.