Search code examples
wkhtmltopdfwkhtmltoimagephpwkhtmltopdf

Setting options in phpwkhtmltoimage


I am trying to reduce the file size of images outputted from phpwkhtmltoimage (php wrapper for wkhtmltopdf)

The image is being saved fine, but the image outputted is exactly the same as having no options set. I am guessing that I am doing something wrong here.

$options = array(
'--dpi 300',
'no-outline',
'--image-quality 10',);

$image = new Image('http://bl.ocks.org/mbostock/raw/7555321/', $options);
$image->saveAs('output.png');

Cheers


Solution

  • Turns out there is no dpi setting for phpwkhtmltoimage nor image-quality. Instead it uses quality.

    array('quality' => 20);