Provide state-of-the-art image capture, screen capture, video capture and audio capture software
Home     Download     Purchase     Support     Contact     View my shopping cart
You are here: ACASystems » ACA WebThumb ActiveX Control » FAQ » Convert HTML to image with ASP

How to convert HTML to image with ASP? - ASP Sample Code

Download ACA WebThumb ActiveX

For Windows 7/Vista/2003/XP/2000

If you are an ASP developer and looking for a solution to convert HTML to image with ASP, you can try our HTML converter SDK - ACA WebThumb ActiveX. With a few function calls in ASP script, it helps you convert html from any URL to image or thumbnails easily and quickly, takes the snapshots of given URLs as JPG, GIF, PNG, BMP, TIFF, WMF and EMF image, you can easily add "HTML to JPG", "HTML to PNG", "HTML to GIF" features in your ASP script.

Guidelines: Convert HTML to image with ASP

  1. Free download ACA WebThumb ActiveX, and then install it on your computer.
  2. You will find rich ASP sample scripts in the folder {install-folder}\sample\asp.
  3. You can copy these sample scripts to your local WWW folder and then open them.

Example code: Convert HTML to image with ASP

1. A simple ASP code for converting HTML to image

<%
  ' ASP code: Convert HTML to image
  ' Create instance ACAWebThumb.ThumbMaker
  set HTML_Converter = server.createobject("ACAWebThumb.ThumbMaker") 
  
  HTML_Converter.SetURL ("http://www.acasystems.com")
  HTML_Converter.StartSnap()
  
  ' Save the image with full size
  HTML_Converter.SaveImage("main-thumb.large.png")
  
  ' Save the image with 320x240 size
  call HTML_Converter.SetThumbSize(320, 240, 0)
  HTML_Converter.SaveImage("main-thumb.small.png")  
%>

2. An ASP code for converting HTML to image in the memory and output to client browser

This ASP sample script shows how to make a web thumbnail in the memory and output to client browser.

<%
  ' Create instance ACAWebThumb.ThumbMaker
  set WebThumbMaker = server.createobject("ACAWebThumb.ThumbMaker") 
  
  WebThumbMaker.SetURL ("http://www.acasystems.com")
  WebThumbMaker.StartSnap()
  call WebThumbMaker.SetThumbSize (320, 240, 0)
  arrImageBytes = WebThumbMaker.GetImageBytes("png") 'get image bytes
  
  ' output the converted image bytes to client
  Response.ContentType = "image/png" ' Get the image bytes by PNG format
  Response.BinaryWrite arrImageBytes
  Response.Flush
  Response.Close
%>
Download ACA WebThumb ActiveX

For Windows 7/Vista/2003/XP/2000

Other resource about Converting HTML to image with ASP:

  • ASP Sample Code: How to take screenshot of web page with ASP?
  • FAQ: Which image format is best?
  • FAQ: What programming languages does ACA WebThumb ActiveX Control support?
  • .Net Sample Code: How to convert HTML to image in ASP.Net??
  • C# Sample Code: How to take screenshot of web page in C#(C-sharp)?
  • ACA WebThumb ActiveX Interface Reference
  • W3Schools: HTML Images

  • Get discount alerts, new product information and technical articles:
    Name:
    Email:
    * Get 10% off your first order by joining our mailing list!
    * You may safely unsubscribe at any time!