Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 441
odbhut.shei.chhele Avatar asked Nov 07 '25 12:11

odbhut.shei.chhele


1 Answers

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.

like image 181
Lokesh Avatar answered Nov 09 '25 01:11

Lokesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!