On my Ubuntu box I have installed htlm2ps in order to convert a simple html file to a GIF. My html file looks like this:
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
</head>
<body style="width: 120px; height: 90px" >
<div>
<div>Gas Prices</div>
<div>Todays local Prices</div>
<div>Low Price 1.29</div>
<div>High Price 1.44</div>
</div>
</body>
</html>
and I run convert like this:
convert -size 120x90 gas.html gas.gif
However, the generated image is always of size 612x712. Same thing when converting to PNG or JPG.
Any ideas what I'm doing wrong?
The
-size
option in Imagemagick is ignored as the page size is determined byhtml2ps
converting the HTML into PostScript. I believe you'll need to set the size of the page with CSS within the document. See @paper option underhtml2ps
's documentation.