-
September 20th, 2011, 06:14 AM
#1
How to convert HTML to TIFF in C#
Hello,
Do you have an code example of how i can convert a html page to TIFF?
Thanks
-
September 22nd, 2011, 11:27 AM
#2
Re: How to convert HTML to TIFF in C#
Are you hosting the browser? If so... just capture your form image and save it as TIFF...
Code:
Rectangle form = this.Bounds;
using (Bitmap bitmap = new Bitmap(form.Width, form.Height))
{
using (Graphics graphic =
Graphics.FromImage(bitmap))
{
graphic.CopyFromScreen(form.Location,
Point.Empty, form.Size);
}
bitmap.Save("D://test.tif", ImageFormat.Tiff);
}
If you're not hosting the browser in your application... google "c# capture window image" for some examples on capturing the contents of other windows as an image.
-
May 14th, 2014, 07:55 AM
#3
Re: How to convert HTML to TIFF in C#
I found this simple and easy to use .net library to convert html to tiff in c sharp.
you can convert your html to jpg, png, gif, tif and bmp.
this library can be used to convert your url to image in any .net project
see this article:
http://www.converthtmltoimage.com/Co...in-vb.net.html
sample code you you:
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();
-
July 30th, 2014, 04:43 AM
#4
Re: How to convert HTML to TIFF in C#
Originally Posted by Johan1974
Hello,
Do you have an code example of how i can convert a html page to TIFF?
Thanks
refer this post on Codeguru - http://forums.codeguru.com/showthrea...03#post2156903
Or try sample for converting Html to Image on MSDN
kind regards
-
February 1st, 2018, 05:11 AM
#5
Re: How to convert HTML to TIFF in C#
You can use itextsharp dll in C# and convert to tiff.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|