1

So what I want to do is have a div on the page saved to the user's device as an image, is that possible?

for example, lets say I have a div like this:

<div id="box"><h3>im a box</h3></div>

and I want this div to be captured and saved to the user's computer when he clicks a button on my website

and if that isn't possible then can I save it as something other than an image, like a pdf file.

Ayoub
  • 25
  • 5
  • you would need to do a post to send the user the "file" since javascript cannot access the client machine. – abc123 Jul 10 '13 at 03:16
  • i would make use of the gd library in php and generate an image server side. – Ray Jul 10 '13 at 03:40

1 Answers1

1

If you're 100% sure that you need this done client-side then check out http://html2canvas.hertzen.com/ It'll take some time integrating this, but it'll work very well in the end.

Mikhail
  • 8,692
  • 8
  • 56
  • 82