HTML2Image For Linux and Unix

Features |  FAQ | History |Support | Buy! | Clients

Have you ever wanted a solution for converting html to image on Linux/Unix? Html2Image for Linux is a command line tool that can convert html to image on Linux or Unix platform.

html2image linux now solves this problem. It is a standalone tool package that can generate raster image from html content. The html page can be on a remote server or local file disk. html2image can convert them into images on the fly.


html2image can convert html to bmp, convert html to png and convert html to jpg. The URL and image file name can be specified on command line paramters, which is useful for batch processing a lot of html files. You can also call the command line program from your favourite programming languages like php or C++ in order to add html to image functionality to your server applications.

You can also control the compression quality of the jpeg image by specifying the quality parameters on command line.

Just one click to download the trial version for free below according to your linux OS and start to convert html to image.  If you need a custom build, please contact us.  
Free download 32 bit Html2Image
Free download 64 bit Html2Image
(Tested on Fedora 8, CentOS 5, Ubuntu 7/8/9, Debian 5)

Previous Versions for older linux systems:
Html2Image for older Linux   (Fedora 4/5/6/7/8, SuSE10, RHEL 4, Ubuntu 6 etc.)
Html2Image for RHEL3

Buy Now $299.95 For Single Server License.

 

html2image uses the cutting-edge html to image renders which can capture html content into high quality bitmap raster image and then save it into popular web image formats like png, jpg or jpeg. If you want to support more image format, you can use the image conversion tool available in linux such as imagemagick to post processing the images like making thumbnaul image etc. An example image converted looks like this:

Normally htmli2image needs a X server to run. But you can run html2image without installing a true X11 server. Xvfb does the trick. With this cool in memory X11 server, you can run html2image without a true display. All the html loading and rendering operations will be done in memory. It will be more fast and suitable for batch html to image conversion on your servers.

Still unsure about html2image linux? Download and try it to convert html to image for free!

 

Notes:If you are looking for a html to image (such as bmp, jpeg, gif, tiff, gif, jpg and png) component on Windows platform, please try our award-winning html snapshot ActiveX, which easily integrated into applications written in languages that support ActiveX Component such as Visual C++, Visual Basic, Delphi, C++ Builder, .Net languages,  Java, Scripts like Perl, Php, Python.

If you are looking for an application that converts html to image. Please try Html To Image


Highlight Features:

  • Capture and save whole html webpage into image
  • Support popluar image format
  • Convert html to bmp, png, jpg and jpeg on Linux
  • Support command line parameters for batch converting html to image
  • Convert html to jpg or jpeg with compression quality control
  • Support saving the whole html page to image without scrollbars.
  • Support batch convert a lot of url to images
  • Support http and https url
  • Support delay capture (useful for capturing html with javascript)
  • Can be called easily from programs or script to convert html to image
  • Can run on 64 bit Linux without problem (tested on ubuntu 64, Fedora 64)
  • You can easily generate thumbnail from html page with additional tools

Version:

2.0.2010.731

Keywords:

convert html to image, html to jpg, html to image, html to tiff, html to gif, html to bmp, html to png
text to image, text to jpg, mht to image, mht to jpg, html2image, convert invoice to image, html to fax, fax tiff,
vml to jpg, vml to image, vml to png, vml to tiff, render vml to image, vml rendering, convert text to image, convert web page to image, convert html to WMF, html snapshot

 

System Requirements:

Linux based OS, GTK 2, Internet connection, High color display mode.

Linux kernel - 2.2.14 or higher with the following libraries or packages:

  • glibc 2.3.2 or higher
  • XFree86-3.3.6 or higher
  • gtk+2.0 or higher
  • fontconfig (also known as xft)
  • libstdc++5

Tested on Red Hat Fedora 5 ,   Novell SuSE Linux 10.0,   Red Hat Fedora 4,   Red Hat Enterprise Linux 4 , Red Hat Enterprise Linux 3

If you system doesn't have libpangocairo, please try to install libpangocairo ( type "rpm -Uivh cairo-1.0.2-1.1.fc4.nr.i386.rpm glitz-0.4.3-1.1.fc4.nr.i386.rpm libpixman-0.1.5-1.1.fc4.nr.i386.rpm pango-1.10.3-1.1.fc4.nr.i386.rpm pango-devel-1.10.3-1.1.fc4.nr.i386.rpm" to install)

If you are using Fedora Linux, You can also to use the software installation tool Yum to install those dependencies.

If you want to do html to image on Solaris, we can work on a Solaris SPARC build.

Known Issues
  • Page content generated by plugins (such as Flash-based content) is not included in saved images.  This problem should disappear after Mozilla bug 313462 is fixed. Instead, you can try our windows based component htmlsnapshot!

 

Generic Usage

Below are generic instruction for using html2image on linux. For different linux distribution,  there may be slightly difference. We gives special instructions for some popular linux distributions after this.  If you feel hard to follow it, please contact us by email or IM for help.

1. Extract the install package to a folder. (for example, /html2image/).

2. Add the folder path to ld path for shared library. For example

export LD_LIBRARY_PATH=/html2image/

or

you can also add the path to html2image to /etc/ld.so.conf, then run ldconfig

3. Run html2image which is a command line tool to convert html to image. (bmp and png image format are supported currently). The following are some examples:

a. Convert url to bmp

html2image www.google.com a.bmp

b. Convert url to jpg

html2image www.google.com a.jpg

c. Convert local html file to png

html2image file://home/user/test.html a.png

4. For more help, type "html2image -h"

5. You can also run html2image with Xvfb on the text mode console. In the html2image folder, run the below comman (Xvfb can be also installed from your linux with tool like apt-get or yum)

./Xvfb :1 -screen 0 640x480x24 -nolisten tcp -audit 4 -auth X1.cfg & export DISPLAY=:1 & ./html2image www.google.com /root/b.png

The command can be called in batch or web CGI script files to convert url or html to image files

How to use html2image linux on Debian Lenny 5 and Ubuntu 8/9

here is detailed example on how to use html2image linux on Debian 5 or Ubuntu8/9. This serves as a good example on how to use html2image.

1. Install Debian 5

2. Login into the server (you can use the text mode login here)

3. Enter a folder, download html2image.

wget http://www.guangmingsoft.net/htmlsnapshot/html2imagev3.ubuntu8.tar.gz

4. Extract html2image

tar xvzf html2image.i386.tar.gz
cd html2image
export LD_LIBRARY_PATH=./

5. Optional: if you want to run html2image without a display (normal  GUI X window) Then you can install Xvfb by running "apt-get install xvfb".  After installation, make sure your Debain can run X window well, the command below should work: 
Xvfb :1 -screen 0 640x480x24 -nolisten tcp -audit 4 -auth X1.cfg & export DISPLAY=:1

6. Now you can run html2image, it should work
./html2image www.google.com a.jpg

How to use html2image linux on CentOS 5

here is detailed example on how to use html2image linux on CentOS 5. This serves as a good example on how to use html2image. Other Linux distribution can be done similarly

1. Install CentOS.

2. Login into the server (you can use the text mode login here)

3. Enter a folder, download html2image

wget http://www.guangmingsoft.net/htmlsnapshot/html2image.i386.tar.gz

4. Extract html2image

tar xvzf html2image.i386.tar.gz
cd html2image
export LD_LIBRARY_PATH=./

5. Make a symbol link for X11

ln -s /usr/share/X11 /usr/X11R6/lib/X11

You should do this to avoid the X11 error "could not open default font 'fixed'"

6. Run Xvfb
./Xvfb :1 -screen 0 640x480x24 -nolisten tcp -audit 4 -auth X1.cfg & export DISPLAY=:1

7. Now you can run html2image, it should work
./html2image www.google.com a.jpg

How to use html2image linux on Ubuntu 7 64

Here is detailed example on how to use html2image linux on Ubuntu 64 bit (Ubuntu 7.10 - the Gutsy Gibbon)

This serves as a good example on how to use html2image. Other 64 bit Linux distribution can be done similarly.

1. Install Ubuntu 64

2. Login into the server (you can use the text mode login here. This is suitable for headless server as well)

If you are in GUI mode, Ctrl+Alt+F2 will switch you to text mode.

3. Enter a folder, download html2image

wget http://www.guangmingsoft.net/htmlsnapshot/html2image.i386.tar.gz

4. Extract html2image

tar xvzf html2image.i386.tar.gz
cd html2image
export LD_LIBRARY_PATH=./

4. Install 32bit application support libraries.

sudo apt-get install ia32-libs

sudo apt-get install lib32nss-mdns (Needed for Ubuntu9)

5. Install Xvfb coming with the Ubuntu

sudo apt-get install xvfb

6. Run Xvfb

Xvfb :1 -screen 0 640x480x24 -nolisten tcp -audit 4 -auth X1.cfg & export DISPLAY=:1
Of course, you could try high resolution like 1024x768x24

7. Now you can run html2image, it should work
./html2image www.google.com a.jpg

Check if the a.jpg is created successfully

How to use html2image linux on Fedora 8 x86_64

Here is detailed example on how to use html2image linux on Fedora 8 64 bit. This serves as a good example on how to use html2image. Other 64 bit Linux distribution can be done similarly.

1. Install Fedora 8 x86_64

2. Login into the server (you can use the text mode login here. This is suitable for headless server as well)

3. Enter a folder, download html2image

wget http://www.guangmingsoft.net/htmlsnapshot/html2image.i386.tar.gz

4. Extract html2image

tar xvzf html2image.i386.tar.gz
cd html2image
export LD_LIBRARY_PATH=./

5. Install Xvfb coming with the Fedora 8

su root

yum install Xvfb

6. Run Xvfb

Xvfb :1 -screen 0 640x480x24 -nolisten tcp -audit 4 -auth X1.cfg & export DISPLAY=:1
Of course, you could try high resolution like 1024x768x24

7. Now you can run html2image, it should work
./html2image www.google.com a.jpg

Check if the a.jpg is created successfully

Use html2image linux with CGI program like php:

How to use html2image Linux in php script:

1. Extract the new package to a folder (for exampe /html2image)

2. add the folder path (/html2image) to /etc/ld.so.conf
run ldconfig on command line to enable the changes.

3. run nweb
./nweb 8181 /html2image

the small web server for html to image is started.

4. You can call the web server in php script.
see html2imagetest.php for example. Please change the IP to your server IP.

Use html2image linux to generate thumbnails of web site

Based on above instuctions, it is easy to convert html to image with html2image.

In some case, the image can be further processed like resizing or cut to meet specific application requirements.

It can be done easily with tool like imagemagick. For example, the below is how to generate thumbnail with it.

First install imagemagick. On ubuntu, you can do:

sudo apt-get install imagemagick

Then resize the result image from html2image with the aspect ratio of original image.

mogrify -geometry 124x63 html2image.jpg

If you don't want to keep aspect ratio, you can run below:

mogrify -geometry 124x63! html2image.jpg

License:

The Server License costs $299.95 per site. It can be used on one Linux server.

Support:

If you have any questions or suggestions regards to Html Snapshot. Please feel free to email us:

Guangming Software support@guangmingsoft.net or htmlsnapshot@gmail.com
Google Groups Subscribe to html to image
Email:
Browse Archives at groups.google.com

FAQ:

1. What image format does HTML2Image Linux support?
Answer: It supports converting html to png and html to bmp as well as html to jpg.

2. What is the runtime dependency of Html2Image?
Answer: There is a depend.txt in the package which lists all the runtime dynamic dependency libraries. You need to have those library on your system.

3. Do you have source code license?
Answer: Yes, we have full source code license. If you want the source code license of html2image linux, please email to us with your usage details.

History:

02/18/2010 Update: update render engine and test html to image on Fedora 8, CentOS 5, Ubuntu 7/8/9, Debian 5 (both x86 and x64)
10/01/2009 Update: update howto run html to image on ubuntu 9 x64
11/30/2008 Update: support x64 linux systems with detailed instruction
06/08/2007 Update: support delay before capture
12/22/2006 Fix https bug
11/06/2006 New build, remove libpangocairo dependency. Xvfb support
07/07/2006 Add php demo and a mini webserver wrapper for using html2image from php
06/26/2006 Add html to jpeg, jpg support
04/16/2006 Initial Release, convert html to image, html to png