CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2005
    Posts
    1

    How to convert html to tiff using C#?

    Have anyone of you a code snipet that would convert html page into tiff picture?

    Thanks!

  2. #2
    Join Date
    Dec 2003
    Location
    http://map.search.ch/zuerich.en.html
    Posts
    1,074

    Re: How to convert html to tiff using C#?

    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.
    Useful? Then click on (Rate This Post) at the top of this post.

  3. #3
    Join Date
    May 2014
    Posts
    2

    Re: How to convert html to tiff using C#?

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

  4. #4
    Join Date
    Apr 2014
    Posts
    23

    Re: How to convert html to tiff using C#?

    Quote Originally Posted by Epics View Post
    Have anyone of you a code snipet that would convert html page into tiff picture?

    Thanks!
    try this
    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);
    Full sample code can be found here -How-to-Convert-HTML-to-Image.

    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
  •  





Click Here to Expand Forum to Full Width

Featured