Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 how to take a print screen on a particular div class or id [duplicate]

I am using html5 webpage i displayed some product list, this list are inside the div tag this is designed using css. i want to print the product list get the css style.

i need to click a button that button to capture and display the window particular div class or id. then to print the div class or id

like image 846
joyson Avatar asked Feb 11 '14 07:02

joyson


1 Answers

These links will give you a good idea of what you are looking for

How to take screenshot of a div with JavaScript?

https://www.idontplaydarts.com/2012/04/taking-screenshots-using-xss-and-the-html5-canvas/

They all do it by using HTML Canvas, if you are new to it then here is a tutorial to help you out

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial?redirectlocale=en-US&redirectslug=Canvas_tutorial

There are other ways too. You can also do it by using a Javascript API

http://grabz.it/api/javascript/

or

http://html2canvas.hertzen.com/

Hope it helped !

like image 103
Nikhil Nanjappa Avatar answered Oct 24 '22 16:10

Nikhil Nanjappa