7

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
joyson
  • 79
  • 1
  • 1
  • 2

1 Answers1

9

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 !

Community
  • 1
  • 1
Nikhil Nanjappa
  • 6,454
  • 3
  • 28
  • 44