Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Feb 122010

Convert HTML to image


Firstly, you need to install html2ps

# sudo apt-get install html2ps

Then install the ImageMagick

# sudo apt-get install imagemagick

Finally run the command:

# convert -density 72 input.html output.png

  2 Responses to “Convert HTML to image”

  1. Does anyone know what to do if style tags don't seem to be included in the images? I even manually put in the styles instead of leaving the stylesheet links there, and it still didn't work. :/


  2. @trilobite, for complicated HTML, probably you would need other methods such as integrate with QT, e.g.

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>