How to convert HTML to TIFF in C#
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: How to convert HTML to TIFF in C#

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Posts
    2

    Post 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

  2. #2
    Join Date
    May 2011
    Location
    Washington State
    Posts
    220

    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.

  3. #3
    Join Date
    May 2014
    Posts
    2

    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();

  4. #4
    Join Date
    Apr 2014
    Posts
    13

    Re: How to convert HTML to TIFF in C#

    Quote Originally Posted by Johan1974 View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center