locked
How to convert html into image? RRS feed

  • Question

  • User-1848583295 posted

    Hi, everyone

    Does any one have idea to convert html coding into image (gif or jpg ... ...)? thanks for any help.

    Thursday, January 8, 2009 6:34 PM

Answers

All replies

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 8, 2009 9:11 PM
  • User-680408237 posted
    Hi stevenye2008,

    You can try ACA WebThumb ActiveX: http://www.acasystems.com/en/web-thumb-activex/

    Here are some sample codes:

    1. Convert HTML to image with ASP:

    <%
    ' ASP code: Convert HTML to image
    ' Create instance ACAWebThumb.ThumbMaker
    set t_xThumbMaker = server.createobject("ACAWebThumb.ThumbMaker")

    t_xThumbMaker.SetURL ("http://www.acasystems.com")
    t_xThumbMaker.StartSnap()

    ' Save the image with full size
    t_xThumbMaker.SaveImage("main-thumb.large.png")

    ' Save the image with 320x240 size
    call t_xThumbMaker.SetThumbSize(320, 240, 0)
    t_xThumbMaker.SaveImage("main-thumb.small.png")
    %>

    2. Convert HTML to image with C#:

    // C# - Convert HTML to Image
    // Set the image filename.

    string t_strSaveFolder = Server.MapPath("./");
    string t_strLargeImage = t_strSaveFolder + "\\" + "main-thumb.large.png";
    string t_strSmallImage = t_strSaveFolder + "\\" + "main-thumb.small.png";
    // Create instance
    ThumbMakerClass t_xThumbMaker = new ACAWebThumbLib.ThumbMakerClass();
    // Start convert web page http://www.acasystems.com to image
    t_xThumbMaker.SetURL("http://www.acasystems.com");
    t_xThumbMaker.StartSnap();
    // Save the image with full size in C#
    t_xThumbMaker.SaveImage(t_strLargeImage);
    // Save the image with 320x240 in C#
    t_xThumbMaker.SetThumbSize(320, 240, 0);
    t_xThumbMaker.SaveImage(t_strSmallImage);
    Monday, January 26, 2009 8:22 AM
  • User-763999832 posted
    Hi, you may try Altsoft Xml2PDF to convert html to gif, gpeg, bmp, png, etc. (http://alt-soft.com/Downloads.aspx)
    Tuesday, February 17, 2009 7:29 AM