phpsizescreenshotwkhtmltopdfwkhtmltoimage

How to specify size when taking screenshot in wkhtmltoimage?


This is my first time using wkhtmltoimage. I am trying to take screenshots of urls. But I need the images to be of width 1024 and height 768; is it possible? Currently it is giving me an image of width 1024 and height 431.

The command I am current using is

"C:/Program Files (x86)/wkhtmltopdf/wkhtmltoimage.exe  --width 1024 --height 768" http://www.google.com/ D:/example.jpg

but it is saying:

'"C:/Program Files (x86)/wkhtmltopdf/wkhtmltoimage.exe --width 1024 --height 768"' is not recognized as an internal or external command, operable program or batch file.

I am using quotations because I using Windows localserver.


Solution

  • Try this,

    C:\Program" "Files" ("x86")"\wkhtmltopdf\wkhtmltoimage.exe  --width 1024 --height 768 http://www.google.com/ D:\example.jpg
    

    or

    "C:\Program Files (x86)\wkhtmltopdf\wkhtmltoimage.exe"  --width 1024 --height 768 http://www.google.com/ D:\example.jpg
    

    you need to combine single parameter as single string.