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.

Free Download & Try Now with the unregistered version. RHEL3 version
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

Version:

2.0.2007.608

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.

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!

 

Usage:

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 command:

./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 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 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

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.

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:

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