Archive for January, 2008

How to Create Webpage Thumbnail with HmlCapture?

Friday, January 18th, 2008

There are two successful ways to make html thumbnails — cropping and resizing. HtmlCapture ActiveX provides SetThumbSize() funtion for resizing and SetClipRect() for cropping. You can use either or a combination of both to make the smaller images.
If you want the thumbnail to give an overview of everything in the picture and don’t care much about the detail, use resizing. If you want the thumbnail to give a much better feel for what the full picture contains, use cropping.

Here are two thumbnails of http://www.microsoft.com/ — one of each type.

 Resized thumbnail image of microsoft.comCropped thumbnail image of microsoft.com

The following codes in JScript show how to get the above thumbnails with HtmlCapture component.
//create HtmlCapture
var snap = new ActiveXObject("HtmlCapture.SnapShooter");
snap.SetRenderingEngine("firefox"); //set firefox as default rendering engine
snap.SnapUrl("http://www.microsoft.com/"); //snap it
snap.SetThumbSize(188, 242, true); //save a resized thumbnail image
snap.SaveImage("microsoft.com_thumb.jpg");

snap.SetClipRect(0,0, 188, 242);
snap.SaveImage("microsoft.com_cropping.jpg"); //save a cropped thumbnail image
snap = null; //release the object

How to Convert Html to Multi-page PDF with HtmlCapture V2.0?

Friday, January 11th, 2008

 Using HTmlCapture ActiveX 2.0, you can easily convert a webpage to multi-page PDF files.

//create HtmlCapture
var snap = new ActiveXObject("HtmlCapture.SnapShooter");
snap.SetRegInfo("username", "regcode"); //set your reg code here
snap.SetRenderingEngine("firefox"); //set firefox as default rendering engine

snap.CreatePDF("snapshot.pdf");

if(0 == snap.SnapUrl("http://www.google.com/“))
 snap.AddImageToPDF();

if(0 == snap.SnapUrl(”http://www.yahoo.com/“))
 snap.AddImageToPDF();

if(0 == snap.SnapUrl(”http://www.polestarsoft.com/“))
 snap.AddImageToPDF();

snap.ClosePDF();

//release the object
snap = null