Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to capture screenshot using JavaScript?

Status
Not open for further replies.

javascripton

Programmer
Jan 5, 2008
2
I need to capture a screenshot (like what is acheived by pressing "print screen"). How is it possible using only Javacript?
Also, is it possible to save contents of a tag - like <img or <div - into a file?
Thanks
 
I need to capture a screenshot (like what is acheived by pressing "print screen"). How is it possible using only Javacript?

It is not.

Also, is it possible to save contents of a tag - like <img or <div - into a file?

Select the required text with the mouse, press ctrl-c, open notepad, press ctrl-v, click the file -> save menu option.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Enable Apps
 
Anyone knows how to do the original questions programmatically using JavaScript?
I have successfully grabbed the entire screen and/or TAGs and copied them to clipboard using ControlRange Object (which is supported only in IE). Therefore there must be a way to take the contants of clipboard and save them (again programmatically!)
Anyone has done anything similar before?
 
You can use the ControlRange methods to copy and paste content on the page. Then you have to use ActiveXObject to save it to a file.. Or if you have it uploaded you can use the php/asp to write it to the server.. or with HTTP request..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top