For Windows 2000. You need to install Speech SDK first to use SAPI 5 voice
http://download.microsoft.com/download/speechSDK/SDK/5.1/WXP/EN-US/speechsdk51.exe
By default, Windows supports SAPI4 voice only
For Windows 2000. You need to install Speech SDK first to use SAPI 5 voice
http://download.microsoft.com/download/speechSDK/SDK/5.1/WXP/EN-US/speechsdk51.exe
By default, Windows supports SAPI4 voice only
Here is detailed example on how to use html2image linux on Ubuntu 64 bit (Ubuntu 7.10 – the Gutsy Gibbon)
This serves as a good example on how to use html2image. Other 64 bit Linux distribution can be done similarly.
1. Install Ubuntu 64
2. Login into the server (you can use the text mode login here. This is suitable for headless server as well)
If you are in GUI mode, Ctrl+Alt+F2 will switch you to text mode.
3. Enter a folder, download html2image
wget http://www.guangmingsoft.net/htmlsnapshot/html2image.i386.tar.gz
4. Extract html2image
tar xvzf html2image.i386.tar.gz
cd html2image
export LD_LIBRARY_PATH=./
4. Install 32bit application support libraries.
sudo apt-get install ia32-libs
5. Install Xvfb coming with the Ubuntu
sudo apt-get install xvfb
6. Run Xvfb
Xvfb :1 -screen 0 640x480x24 -nolisten tcp -audit 4 -auth X1.cfg & export DISPLAY=:1
Of course, you could try high resolution like 1024x768x24
7. Now you can run html2image, it should work
./html2image www.google.com a.jpg
Check if the a.jpg is created successfully.
Here are a more complete examples of using htmlsnapshot to convert html to image with php on Windows.
Note the following things:
1. You copy/paste the below code into test.php and run on command line
php.exe test.php
2. Yon can see it uses GetErrorCode to handle errors to make your code more robust.
<?php
$url = “http://google.com/“;
$path = “.\\”;
$img = “1.jpg”;
$timg = “1s.jpg”;
$limg = “1b.jpg”;
$iimg = “1i.jpg”;$com = new COM(“HTMLSNAP2.HtmlSnap.1″);
$com->SetTimeout(150000);
$com->SetDelayTime(5000);
$com->EnableActiveX(true);
$com->EnableJava(true);
$com->EnableScript(true);
$com->EnableActiveX(true);
$com->SetJPEGQuality(100);
$com->SetSmoothingMode(2);
$com->SetInterpolationMode(6);
$com->SnapUrl($url, $path.$img );$err = $com->GetErrorCode();
if ($err == 1)
{$com->SetClipRect(0, 0, 1024, 768);
$com->SaveImage($path.$iimg);$com->GetThumbnailImage($path.$img, $path.$timg, 160, 120, 0);
$com->GetThumbnailImage($path.$img, $path.$limg, 320, 240, 0);
$com->Clear();print “Snapshot of “.$url.”. Click to enlarge<br>”;
print “<a href=”.$iimg.” mce_href=”.$iimg.”><img src=”.$timg.” mce_src=”.$timg.”><img src=”.$limg.” mce_src=”.$limg.”></a><br/>”;
}
else
{
print “error happens”;
}
?>
Cold fusion is a CGI language like asp, php. Sometimes, you may need to call an external exe in coldfusion.
It is absolutely doable in coldfusion. For exmaple, if you want to call cscript.exe, here is what you can do:
<cfexecute name = “C:\Windows\System32\cscript.exe”
arguments = “pdfmerge.vbs c:\1.pdf|c:\2.pdf c:\out.pdf”
outputFile = “C:\Temp\output.txt”
timeout = “100″>
</cfexecute>
You may need to run a command line utility to convert html or url to image. Here is a handy script that converts url/html to image with our award winning htmlsnapshot product.
Save the below code into a script snapurl.vbs (Or you can find this script in htmlsnapshot\demo\vbscript)
set args = WScript.Arguments
num = args.Countif num <> 2 then
WScript.Echo “Usage: [CScript | WScript] snapurl.Vbs Url ImageFile”
WScript.Quit 1
end if‘demo how to convert html to image
Dim snap‘Create the Html Snapshot Object
Set snap = CreateObject(“HTMLSNAP2.HtmlSnap.1″)
snap.SetCode “Input your license code here to remove watermark”
snap.SnapUrl args.Item(0), args.Item(1)
WScript.echo “Snap return:” & CStr(snap.GetErrorCode)‘Free object
Set snap = Nothing
After that, you can run on command line like below:
cscript.exe snapUrl.vbs www.google.com g.jpg
cscript.exe snapUrl.vbs file://c:\1.html g.jpg
Silverlight is the new web authoring technology proposed by Microsoft. It is implemented as an ActiveX like the Flash.
It can be used to build interactive, vector based web pages.
To convert such web page into image, you can do it with our award winning htmlsnapshot product.
Firefox debug version has a lot of assertion warnings.
I felt confused that they are not got fixed even in latest version 3
A way to disable the warning is here:
When making a debug build of Firefox from the CVS trunk you get lots of warning boxes appearing when it runs. These warnings are about failed assert checks and can usually be ignored if you’re not working on that area directly.
To turn off these warnings you can set an environment variable on Windows as follows:
SET XPCOM_DEBUG_BREAK=warn firefox -Profilemanager
On Linux, something like:
XPCOM_DEBUG_BREAK=warn ./firefox -ProfileManager
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”, 200snap.SetTIFFEncoder 1
‘Change thresholding when converting to monochrome
snap.SetThreshold 200
snap.SaveMultipageTiff “m-google-ccitt-4-1.tiff”, 200Set snap = Nothing