Monthly Archives: December 2007

Convert html to multipage tiff file

 Htmlsnapshot now supports converting html into multiple page tiff files. here is the sample code. You just need to specify the page width in pixel. The component will save the image into a multipage tif.

‘demo html to multipage tiff generation function

Set WshShell = WScript.CreateObject(“WScript.Shell”)
‘Declare object
Dim snap
Set snap = CreateObject(“HTMLSNAP2.HtmlSnap.1″)
snap.SetTimeOut CLng(200000)
snap.SnapUrl “http://www.google.com/“, “google.tiff”

‘Set CCITT3 encoding for TIFF
snap.SetTIFFEncoder 1
snap.SaveMultipageTiff “m-google-ccitt-3.tiff”, 200

‘Set CCITT4 encoding for TIFF
snap.SetTIFFEncoder 2
snap.SaveMultipageTiff “m-google-ccitt-4.tiff”, 200

‘Set RLE encoding for TIFF
snap.SetTIFFEncoder 3
snap.SaveMultipageTiff “m-google-rle.tiff”, 200

‘Set none encoding for TIFF
snap.SetTIFFEncoder 4
snap.SaveMultipageTiff “m-google-none.tiff”, 200

snap.SetTIFFEncoder 1

‘Change thresholding when converting to monochrome
snap.SetThreshold 200
snap.SaveMultipageTiff “m-google-ccitt-4-1.tiff”, 200

Set snap = Nothing