Manish Gautam
Manish Gautam

Reputation: 516

Convert a div and contents inside it to image

I have a DIV container which has some text, background-image, image. I need to convert that whole DIV contents into image and save.

I have googled it around but could not find the perfect answer. some are giving answers that uses a windows application , but i need it on a web platform .

any help will be highly appreciated

Upvotes: 3

Views: 2838

Answers (3)

Bloafer
Bloafer

Reputation: 1326

This is possible, with modification to the code here http://html2canvas.hertzen.com/screenshots.html you could perform the required screenshot :)

Upvotes: 0

frosty
frosty

Reputation: 21762

http://html2canvas.hertzen.com/

Does't support IE though. Looks solid other than that.

Upvotes: 1

njord
njord

Reputation: 1288

From what I understood, you have to do that in the client side, so you should take a look at the toDataURL method of the canvas.

If you don't know, the canvas support text and image.

Example and little library at this link: http://www.nihilogic.dk/labs/canvas2image/

Upvotes: 1

Related Questions