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
C#
$("#btnimage").click(function () {
            html2canvas($("#print"), {
                onrendered: function (canvas) {
                    theCanvas = canvas;         
                    Canvas2Image.saveAsPNG(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 asp.net . Is there any solution for this plz help
Posted
Comments
   
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.
—SA
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...
—SA
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...
—SA

1 solution

Hey check out the below link this might help you out.

http://forums.asp.net/t/1764959.aspx?About+Div+Tag+convert+into+image+in+c+[^]
   

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