2

I have a website which generates HTML tags dynamically in a specific div. Now after all the HTML tags are created I save these HTML tags in Database. The problem is that I need to take the Screen Shot of the web page where the HTML Tags are generated. when I am about to save it, but;

  1. I cant Imagine where to begin as far as the screen shot thing goes.
  2. I don't want to use Third party API as what they generally do is ask for a url and then go to the website take a screen shot and then email it to you.

why I cant use them is because when i dynamically create HTML Tags they are just on the browser. if someone else try to access the same link they will get a page without the currently created HTML Tags (even if I refresh the page the tags are gone.).

I dont want a complete solution just a Tip on how to start building the solution for this problem, and by screen shot I mean Images.

Thank you.

Nagri
  • 3,008
  • 5
  • 34
  • 63
  • What is the end goal? What are the screenshots for? – turiyag Feb 11 '13 at 10:44
  • possible duplicate of [Using HTML5/Canvas/Javascript to take screenshots](http://stackoverflow.com/questions/4912092/using-html5-canvas-javascript-to-take-screenshots) – AD7six Feb 11 '13 at 10:47
  • possible duplicate of [Website screenshots using PHP](http://stackoverflow.com/questions/757675/website-screenshots-using-php) – Quentin Feb 11 '13 at 10:48

3 Answers3

4
Gerrit Bertier
  • 4,101
  • 2
  • 20
  • 36
1

My recommendation would be to use PhantomJS, it's sort of a web browser that you can run via command line, and specify the output. You can specify it to be an image, a pdf, or other things.

The bad thing is that you need somewhere to point it, but otherwise it's excellent for these kinds of things. But it doesn't have to be a public url, it could be used internally, or maybe even supply the html from somewhere else.

Joakim Johansson
  • 3,196
  • 1
  • 27
  • 43
1

Use webshot library it is simple and easy to use. you can also use window.print() method to take screen shot of webpage

Tushar Kale
  • 159
  • 1
  • 12