Convert EMF or WMF to Image

Html snapshot supports converting html to vector image format such as EMF  and WMF.

Now it also supports the function to convert EMF or WMF into raster image format like JPG, JPEG, BMP, TIFF, PNG or GIF.

Instructions:

1. Download the latest version of html snapshot and install

 http://www.guangmingsoft.net/htmlsnapshot/HtmlSnapSetup.exe

2. Try the VBScript demo html2wmf.vbs

‘demo how to generate vector format WMF file

Set WshShell = WScript.CreateObject(“WScript.Shell”)
‘Declare object
Dim snap
Set snap = CreateObject(“HTMLSNAP2.HtmlSnap.1″)
snap.SetTimeOut CLng(200000)

snap.SnapUrl “http://www.macromedia.com/“, “2.emf”
‘convert emf to jpg
snap.ConvertEMFToImage “2.emf”, “0.jpg”, 6000, 6000, 0

‘convert emf to tif, keep aspect ratio
snap.ConvertEMFToImage “2.emf”, “1.tif”, 6000, 6000, 1

Set snap = Nothing

The method ConvertEMFToImage is to convert EMF into raster images. The first parameter is the input EMF file, second is the output raster image, the third and fourth are the width and height for the raster image in pixels. The last paramater is to control if the raster image will keep the same aspect ration as to the original vector image.