Image generator plugin

I am looking for a Javascript (jQuery, if possible) plugin that can generate an image representing the internal contents of a DIV .

Example. This link shows an image containing 3 x 3 windows. layoutideas

I would like these fields to contain an automatically generated image showing what the specific contents of the DIV look like.

Is there such a thing?

+6
source share
3 answers

If you have too little content on the screen, this seems like a simple option.

html2canvas

  • This is well documented.
  • Well tested
  • But this will not work for all elements
  • It will not work with all attributes.

But this is a solution if you want to take a snapshot of only your page (where you know the possible attributes and elements)

+1
source

I don't think Javascript can create an image from scratch, but you can certainly do it on the server and use JS to call AJAX.

Hope this helps.

+1
source

You can use "webkit to image" wkhtmltoimage: https://code.google.com/p/wkhtmltopdf/ I used it to create images from charts and javascript tables, etc. Any html will work. This is not pure javascript, but you can send the html div (and the corresponding css) to wkhtmltoimage and return the image via ajax.

0
source

All Articles