Click here to Skip to main content
15,032,256 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i want to convert a div content to image and download it user friendly.
im using following code for it
$("#btnimage").click(function () {
            html2canvas($("#print"), {
                onrendered: function (canvas) {
                    theCanvas = canvas;         


this code work but user have to give extension when downloading it. i need to popup a save box with selected extension .PNG instead of .allfiles(*.*) . I found one solution for php . but i m working in . Is there any solution for this plz help
Why, for goodness sake?! Bad idea...
A Web application does not generate any certain rendering of any elements, a browser does it depending on many factors (size of the window, first of all). A Web application generally does not have access to it.
rajin kp 16-Jul-14 2:38am
have another option ?pls share
Why would anyone ever need this png? There is "Save Page As...", which is millions times better...
rajin kp 16-Jul-14 2:46am
hum Client .
Sorry, it's hard to believe. Such things happen when yet another illiterate marketing specialist brings the "requirements" to the developers team. The companies where a developer cannot ask "why doing that trash?" don't leave long...
The problem has no certain formulation and makes no sense, because there is no certain rendering of a div...

1 solution

Hey check out the below link this might help you out.[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900