tags:

views:

169

answers:

2

Hi , I have a requirement to convert a webpage into a image. When a user clicks a button the new window need to display the webpage as a image.

IS it possible to do in Javascript or Google web tool kit?

+2  A: 

http://stackoverflow.com/questions/60455/take-a-screenshot-of-a-webpage-with-javascript

Firefox has a "drawWindow" method on the canvas element that lets you copy a screenshot of the window into a canvas element (from where it can then be extracted). This is however not enabled for webpages (only for add-ons), because it forms a security risk: http://mxr.mozilla.org/mozilla/source/content/canvas/src/nsCanvasRenderingContext2D.cpp#2352

In short, plugins (or activex components) are the only sure way to go. Browsers aren't going to provide this as standard functionality because the risks outweigh the benefits.

Joeri Sebrechts
A: 

Thanks but I don't want to use the ActiveX controls and I need to use this code with the Google Web tool kit

Arthik