Exporting options in HTML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    Exporting options in HTML

    Hi,
    I am trying out to create a JPEG image file from HTML. Is there any option to Export HTML Objects as an Image. Any suggestion would be helpful.


    Thanks and Regards
    Ramanan Kalirajan
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    nope. (well, at least where JavaScript is concerned). For that you need a device that can render HTML.

    PS. and don’t post questions in the Insights section

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5390

      #3
      do you want to export HTML on the client? ... there are no basic possibilities but you could be of luck for specific browsers like FF for example. the following quick hacked code produces an image in the current FF-window and creates a 'screenshot':

      Code:
      netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
      
      var canvas  = document.createElementNS( "http://www.w3.org/1999/xhtml","html:canvas" );
      var context = canvas.getContext( "2d" );
      
      context.drawWindow( content, 0, 0, 1000, 1000, "rgb(255,255,255)" );
      
      document.body.appendChild(canvas);
      just tried from the firebug-console with google and it appends the image to the document. as you see it needs enhanced privileges and uses canvas ... and produces png-images.

      you might use that as a start and play wit it :)

      kind regards
      gits

      Comment

      • RamananKalirajan
        Contributor
        • Mar 2008
        • 608

        #4
        Its pretty new to me. I will work on it. Thanks for the help... I will start exploring it.

        Thanks and Regards
        Ramanan Kalirajan

        Comment

        Working...