Have anyone of you a code snipet that would convert html page into tiff picture?
Thanks!
Printable View
Have anyone of you a code snipet that would convert html page into tiff picture?
Thanks!
One possibility would be to embed the web browser control in a Form to render the html and then copy its contents into a Bitmap. This Bitmap can then be saved in TIFF format.
I use Websites Screenshot component in all my .NET projects requires HTML to Image conversion.
This component can be use to convert url to image and local html files to image.
See this Article:
http://www.converthtmltoimage.com/Co...in-vb.net.html
Sample code for you to try:
WebsitesScreenshot.WebsitesScreenshot _Obj;
_Obj = new WebsitesScreenshot.WebsitesScreenshot ();
WebsitesScreenshot.WebsitesScreenshot.Result _Result;
_Result = _Obj.CaptureWebpage("http://www.google.com");
if (_Result == WebsitesScreenshot.WebsitesScreenshot.Result.Captured)
{
_Obj.ImageFormat = WebsitesScreenshot.
WebsitesScreenshot.ImageFormats.TIF;
_Obj.SaveImage ("c:\\google.tif");
}
_Obj.Dispose();
try this
Full sample code can be found here -How-to-Convert-HTML-to-Image.Code:Document document = new Document();
document.LoadFromFile(@"D:\test.html", FileFormat.Html, XHTMLValidationType.None);
Image image = document.SaveToImages(0, ImageType.Bitmap);
image.Save("Sample.Tiff", ImageFormat.Tiff);
regards,