Download ACA WebThumb ActiveX |
For Windows 7/Vista/2003/XP/2000
If you are a Java developer, you may want to convert web page to image in Java project and then save it as JPEG/GIF/PNG/BMP format or directly output the image bytes in memory to client browser. To add this feature to your Java project, ACA WebThumb ActiveX is best your choice. It's a developer SDK for coverting HTML page to image, it takes the snapshots of given URLs as JPG, GIF, PNG, BMP, TIFF, WMF and EMF image. In this tutorial, we will see how to convert web page to image with Java and Eclipse environment.
Note: This demo requires JDK (JRE) and Eclipse. please make sure you have installed the Java development environment
Java script file: CSnapSample.java
import org.eclipse.swt.ole.win32.Variant; public class CSnapSample { static final String progId = "ACAWebThumb.ThumbMaker"; public static void main(String[] argv) { System.out.println("Ready to start..."); /** * Create the COM interface */ CComObject t_xCom = new CComObject(); t_xCom.CreateComObjectProgID(progId); /** * Set the license key to unlock the trial limit. To get a license, please visit: * http://www.acasystems.com/en/buynow.htm */ // String t_strRegcode = "AAAAAAAAA-BBBBBBBBB-CCCCCCCCC-DDDDDDDDD"; // t_xCom.CallFunction( "SetRegInfo", new Variant[] { new Variant(t_strRegcode) } ); /** * Set the URL */ String t_strURL = "http://www.google.com"; t_xCom.CallFunction("SetURL", new Variant[] { new Variant(t_strURL) }); /** * Start snap */ Variant t_vRet = t_xCom.CallFunction("StartSnap"); /** * Save the image */ if (0 == t_vRet.getLong()) { String t_strFile = "c:/google.png"; t_xCom.CallFunction("SaveImage", new Variant[] { new Variant(t_strFile) }); System.out.println("Completed."); } else { System.out.println("Failed."); } /** * release */ t_xCom.dispose(); } }
Download ACA WebThumb ActiveX |
For Windows 7/Vista/2003/XP/2000