Reputation: 155
I'm searching for Javascript (JQuery if possible) plugin that can generate an image representing the inner content of a DIV.
Example : This link shows an image containing 3 x 3 box display.
What I would like is that these boxes could contain an automatically-generated picture showing what a specific DIV's content look like.
Is there such a thing?
Upvotes: 6
Views: 1048
Reputation: 7325
You could use "webkit to image" wkhtmltoimage: https://code.google.com/p/wkhtmltopdf/ I've used it to generate images from javascript graphs and tables etc. Any html will work. Its not purely javascript, but you could send the html div (and relevant css) to the wkhtmltoimage and get the image back via ajax.
Upvotes: 0
Reputation: 2150
If you don't have too much content on the screen, this seems like a simple option
But this is the solution if you want to take the screenshot of your page only(where you know the possible attributes and elements)
Upvotes: 1
Reputation: 1345
I don't think that Javascript can create an image from the scratch, but for sure is possible to make that on the server and use JS to make an AJAX call to it.
Hope this helps.
Upvotes: 1