Converting html

I need to convert a simple webpage to PDF and picture format. Usually, I would just take a screenshot, however it is too big. I searched and I found a nice little tool, called wkhtmltopdf. It can be easily installed from SBo. To convert a webpage to PDF, using default settings, is extremely easy. Just do the following in the terminal:

wkhtmltopdf example.html example.pdf

I was pleasantly surpised to find an additional program in the package, called wkhtmltoimage. It does what the name suggests — converts your html file to an image. Its use is also very easy:

wkhtmltoimage --format png --quality 100 example.html example.png

The above command will convert the html file to png, with high quality (100). Very nice!



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s