Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wkhtmltopdf error: specified in incorrect location

Tags:

wkhtmltopdf

This is a part of my shell script, where ${1} is 'input.html' and ${2} is 'output.pdf':

wkhtmltopdf "${1}" "${2}" --page-size letter --dpi 150 --margin-top 0.2in --margin-bottom 0.2in --margin-left 0.2in --margin-right 0.2in

When I ran the above, I got the following error:

--page-size specified in incorrect location

My wkhtmltopdf version:

$ wkhtmltopdf --version

wkhtmltopdf 0.12.0 final
like image 663
Abhijay Ghildyal Avatar asked May 06 '26 05:05

Abhijay Ghildyal


1 Answers

Changed it to:

wkhtmltopdf --page-size letter --dpi 150 --margin-top 0.2in --margin-bottom 0.2in --margin-left 0.2in --margin-right 0.2in "${1}" "${2}"

and it worked.

like image 59
Abhijay Ghildyal Avatar answered May 11 '26 16:05

Abhijay Ghildyal



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!