HTML Snapshot ActiveX Component
Not only html files, the plain text files as well as the Web Archive Format (*.MHT) files can be converted to image with HTML Snapshot easily, too.
HTML Snapshot can capture web pages with flash movie without problem. Check out the snapshot of macromedia.com. Get interested?
Html Snapshot can convert the VML - the Vector Markup Language to image. VML markup can be embeded in html files so it can be converted just like "html to jpg". SVG can be also supported with the Adboe SVG plugin installed.
HTML Snapshot can allow you to batch process URLs from a text file and automatically parse a large number of sites. HTML Snapshot is a standard COM DLL server, allowing you to generate a thumbnail via query string from your web browser. This is an easy to use HTML to image converter.
You may want to control the compression quality of JPEG or change the compression method of TIFF image. No worry. Html Snapshot has done these for you. For TIFF, you can easily get images ready for Windows FAX Service.
You can also convert html into vector image format like WMF and EMF. The result image can be rendered into high quality bitmap format later.
Html snapshot can generate transparent GIF from html as well. Sometimes, you may want to convert 24 bit color bitmap file to gif file, which only supports 256 colors. Html Snapshot provides function to effectively reduce the color in image while keeping the quality of the image as much as possible.
With Html Snapshot, you can build thumbshot server for millions of web pages easily. You have full control of the database yourself. And Html Snapshot is especially suitable to be used on server side. It works well on Windows 2000 Server, Windows 2003 Server and can be used with popular server side script languages like ASP, ASP.Net, PHP and Perl etc. No need to pay monthly subscription fee for thumbshot service providers now!
HTML Snapshot ActiveX Component can take (capture) a whole snapshot of a given URL. It downloads web page and then capture it as image. It can be 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.
Here is the snapshot of this page captured by HTML Snapshot.
In short, if you are looking for the programs, such as convert html to image, html image, html2image, html to image, htm2img, htm to img, html2gif, html to gif, html2jpg, html to jpg, html2jpeg, html to jpeg, html2bmp, html to bmp, html2png, html to png, html2tiff, html to tiff, software to convert html to image, Html Snapshot is suitable for your purpose. HTML Snapshot works with all Windows version with Internet Explorer 5.0 or above and with Internet Connection. It is a program without any hassle to install. Just save it to your desktop and run our demos.
My fellow programmers, don't spend your precious time to reinvent the wheel now. Get Html Snapshot for ONLY $149.95 NOW! Then you can easily add the "Html to jpeg" function to your web or desktop applications. You can call it from your favorite development tools. Many working examples are supplied. Just have a look at them, you will find html snapshot is so easy to use.
Note: If you are
looking for an application that converts html to image. Please try
Html To Image
Unsure? Unconvinced? I understand. We'll also throw in FREE tech support
But if you're still not sure, try it out for FREE in your applications to convert html to image NOW.
We are committed to improving Html Snapshot Component constantly. See History
We have also posted a series of tutorial articles to help you use html snapshot. Feel free to read it.
Windows Platform, Internet Explorer 5 above, Internet connection, High color display mode.
SnapUrl(String strUrl, String strPicFile);
Description: the main function to convert html to image
strUrl: The URL of the web page to be taken snapshot.
strPicFile: The local image file to be
saved. It should be a valid file name. For example, c:\1.jpg or c:\1.bmp
etc. Currently the component supports jpg, bmp, gif, tiff and png format.
It will convert html to image in the format given by the file
SnapHtmlString(String strHtml, String strPicFile);
strUrl: A html string
strPicFile: The local image file to be saved.
Description: 1 is for firefox rendering engine, 0 for IE rendering engine (default)
Htmlsnapshot now supports using firefox to render html to image on Windows. The steps are:
1. Install Htmlsnapshot
2. Install Firefox Addon for HtmlSnapshot
3. In your code, call SetRenderEngine to enable firefox like this:
Note, Firefox engine doesn't supports converting html to vector image.
GetThumbnailImage(String strInputFile, String strOutputFile, Long cx, Long cy, Long bRemainRatio)
strInputFile : The input image file
strOutputFile : The thumbnail image file to be saved
cx, cy : The dimension of the thumbnail image.
bRemainRatio: If bRemainRation is 0, the thumbnail image will be exactly the size of cx, cy; else then remain the original image's aspect ratio.
ReduceColor(String strInputFile, String strOutputFile, Long nColors)
Description: Reduce the color number in input image. nColors is in [8-256].
MakeGrayImage(String strInputFile, String strOutputFile, Long bGrayOrBW)
Description: convert a color image to gray or black white only. If bGrayOrBW = 0 then, the result image is black white only, else it is gray.
strCode : Set the registration code to eliminate the limitation in trial version.
nTimeOut : The time out value in milliseconds for SnapUrl. Using this to avoid hang. The default TimeOut value is 30000
nDelayTime: The time value in milliseconds to wait after a html document is downloaded. Sometimes, a page contains ActiveX like flash, which takes some time to initialize. This method can be used to control the timing to capture the content of the dynamic embeded objects. Default nDelayTime value is 1000.
SetProxy(String proxyHost, String userName, String passWord, LONG autoConfig)
Description: allow to set custom proxy for IE
ProxyHost: could be an IP:port pair. Like this 127.0.0.1 or 127.0.0.1:3128
bAsync : If set to True, SnapUrl function will work asynchronously, which means it will return immediately without waiting for the results. Application can use the event to determine if the operation is done. If set to False, SnapUrl will wait until the operation is done or the time is out.
bEnable : Determine if ActiveX is enabled on the html page
bEnable : Determine if Java is enabled on the html page
bEnable : Determine if Script is enabled on the html page
SetSnapDimension(long cx, long cy)
Description: Set the width and height of the web browser window. The browser window size will affect the html document size in some way.
Description: Force the captured image size to be the dimension set by SetSnapDimension. If the dimension is larger than that of the html document, the gap will be filled with background color of the page. The default value is FALSE.
Description: Set the data to be posted to the URL. Use this function for some urls protected by forms.
SetJPEGQuality (long n)
Description: Set the quality of JPEG Compression. n is between 0 and 100
Description: Set the dither method when converting to 1bpp image. 0: None; 1: Floyd dithering; 2:Ordered dithering
Description: Set the compression method of TIFF image. 0: LZW; 1: CCITT3; 2:CCITT4; 3: RLE; 5: None.
Description: Set the threshold value (0-255) when converting image to monochrome.
Description: Return an array of links on the webpage. Call this function after SnapUrl
Description: Return an array of frame urls on the webpage. Call this function after SnapUrl
Description: Return the title of the webpage. Call this function after SnapUrl
Description: Return the html source of the webpage. Call this function after SnapUrl
Description: Return the text of the webpage. Call this function after SnapUrl
Description: Return the image width. Call this function after SnapUrl.
Description: Return the image width. Call this function after SnapUrl.
Description: Return the bitmap handle to the image (the whole image or the clip rect) in memory. Call this function after SnapUrl. Note: you need to free the bitmap handle with DeleteObject Win32 API.
SetClipRect(long x, long y, long w, long h)
Description: Set clip rect to the image. Call this function after SnapUrl. This method affects GetBitmapHandle and SaveImage. Call this function if you want to get/save portion of the image. SetClipRect(0, 0, 0, 0) will clear the clip rect.
Description: Save the clip rect in the image to file . Call this function after SnapUrl.
SaveMultipageTiff(String strPicFile, LONG Height)
Description: Save the clip rect in the image to multiple page TIFF file. The height is the page height of the TIFF file. See Demo\VBScript\multipage-tifftest.vbs
Description: Set smoothing mode of resizing. Could have below values.
HtmlSnapSmoothingModeDefault = 0,
Description: Set interpolation mode of resizing. Could have below values.
HtmlSnapInterpolationModeDefault = 0,
Description: Get cookie of current URL. Call this function after SnapUrl.
SetCookie(String strURL, String strName, String strData)
Description: Set cookie for the URL.
Description: Get cookie for the URL.
Description: Get html document's IDispatch interface. Call this after calling SnapUrl. With this method, you can access the DOM tree of html document, and even change the document.
Description: Capture the image again after calling SnapUrl. This function will refresh the image in the memory, then you can call SaveImage or GetBitmapHandle to get the new image.
Description: Set the zoom ratio of the html page when doing snapshot. This can result in image with larger DPI.
SetDPI(LONG xDPI, LONG yDPI)
Description: Set the image resolution on x, y axis. Some image formats like TIFF support DPI information.
Description: Get the in memory compressed image bytes. In this way, you can convert html to image in memory. See blob.vbs for detail
GetThumbImageBytes(String imageType, LONG cx, LONG cy, LONG bRemainRatio)
Description: Get the in memory compressed thumbnail image bytes. In this way, you can get the thumbnail images of the html page in memory. See blob.vbs for detail
Description: Return the status code of last snap action. See OnStatus section below for the meaning of the error code
Description: Release the resources allocated when doing SnapUrl or SnapHtmlString.
SetLogonUser(String userName, String domainName, String passwd)
Description: This method will set the user name and password. SnapUrl will do impersonation with the specified user name and convert html to image under that user account. This method is useful for using html snapshot in IIS with ASP or ASP.Net etc.
Description: This method will make the component to capture the browser image even the time is out in some case.
SnapWebBrowser(WebBrowswer browserObject, String strFile)
Description: This method will capture the content in existing web browser window into image files like jpg, tiff, png, gif etc. browserObject is a IDispatch pointer to the browser object. strFile is similar to the file name in calling SnapUrl
Description: Set the working mode of SnapUrl. 0 is the normal method. 1 is to use the method as SnapWebBrowser
DrawTxt(LONG x, LONG y, String strText, LONG nFontSize, LONG nColor, String strFontName)
Description: draw watermark text on the snapped image at the specificed position with the given size, color and font
SetAuthUserAndPasswd(String userName, String password)
Description: set http authentication user name and password so that SnapUrl can bypass the autentication dialog automacically.
Description: return 1 if the strURL's content type is text/html, else return 0
void OnProgress(LONG nPos)
This event tells the downloading progress of the webpage by the Web Browser. Just like what is seen in the Internet Explorer itself. nPos is between 0 and 100.
void OnStatus(String strStatus, LONG nCode)
This event tells the state of the HTML Snapshot control. strStatus is the string description of the state. nCode is the state code, it can has the following value:
0: The normal state.
1: The snapshot is successfully taken.
-1: Fail to take the snapshot of the page.
-2: Fail to save to file.
-3: Fail to open the URL.
-4: Time is out before taking a snapshot
Applications can use the above code to do correspondent actions.
The files that need to redistribute HTML Snapshot Component with applications are:
HtmlSnap2.dll: the component itself. It needs to be registered as ActiveX by regsvr32 or setup program.
Once registered, you can
redistribute HtmlSnapshot ActiveX royalty-freely. (For details about
redistribution, please refer to the license agreement)
If you have any questions or suggestions regards to Html Snapshot. Please feel free to email us:
1. What image format does HTML Snapshot support?
2. Does it support pages with flash animation?
3. What languages does it support?
4. Does it capture the full html page?
5. How do I register the component?
6. Why does the image captured on my server look in poor color quality?
7. Can you do custom development for special usage?
8. Does html snapshot depend on IE?
9. Does html snapshort support html to image on 64 bit Windows ?
10. Do you have source code license for html snapshot?
History:08/19/2012 +Update: fully support to convert html to jpg, jpeg on windows 8
07/31/2010 +Fix: bug under x64, auto registeration in x64
02/08/2010 +Update: some small bug fixes
04/01/2009 +Update: java sample and vs2009, windows 7 support
04/01/2008 +Add: proxy support
02/08/2008 +Add: support converting html to image with firefox rendering engine (gecko)
12/22/2007 +Add: support multipage TIFF file
11/18/2007 +Some small bug fixes
07/06/2007 +Update: Add a method to detect the content type of a URL
05/01/2007 +Update: Java demo, x64 and .Net wrapper version updated.
01/01/2007 +Add: Draw text function and new demos
12/10/2006 +Add: Ruby example (convert html to image in Ruby on Rails, ROR). x64 experimental version
11/18/2006 +Add: AutoClipMargin method to remove nosense white area in the image converted from html
10/18/2006 +Add: SetSnapUrlWorkingMode method
09/22/2006 +Add: SnapWebBrowser method and demo
08/26/2006 +Fix: Support IE 7 on XP SP2 and Vista
04/26/2006 +Add: convert html to EMF and WMF. Add GIF transparency support
03/25/2006 Improve large html image support
02/11/2006 +Add: Samples in Windev from Gilbert
01/15/2006 +Add: Update C# demo, provide a strong named dll for .Net, add meta refresh support
10/06/2005 +Add: Add PowerBuilder, Visual FoxPro demo. And some small fixes.
09/29/2005 +Add: Update document
08/08/2005 +Add: SetDPI method to change DPI. Update VC demo.
05/01/2005 +Add: GetThumbImageBytes method and .Tif extension support
03/26/2005 +Add: GetImageBytes method
03/02/2005 +Add: SetZoom method
02/01/2005 +Fix: Minor bug fix
01/01/2005 +Add: Dither support
11/25/2004 +Add: Allow changing the compression method of TIFF
11/15/2004 +Add: Java, Python examples
11/07/2004 +Update to 2.1, add some powerful functions for advanced users
10/29/2004 +Fix: Kill popup.
10/21/2004 +Add: "GetFrames" method
10/16/2004 +Fix:a bug in Win98
10/15/2004 Now support converting html string to image
10/5/2004 Add time out error code for SnapUrl.
9/26/2004 Add PHP, Perl examples. Add SetSnapDimension method
9/25/2004 Add Delphi example, and google page rank free feature.
9/18/2004 Version2.0 as ActiveX component. Add ASP, ASP.Net and Script examples
9/16/2004 Add VB.Net, VC# Example
8/01/2004 Initial Release, convert html to image, html to jpg