I am using this, it works fine. but do we have any c# library for canvas
instead of below jquery canvas code i want c# canvas code to export div to image
<script type="text/javascript">
function ConvertToImage(btnExport) {
html2canvas($('[id*=dvTable]')[0], {
onrendered: function (canvas) {
var base64 = canvas.toDataURL();
$("[id*=hfImageData]").val(base64);
__doPostBack(btnExport.name, "");
}
});
return false;
}
this is how i am calling the funciton from page behind
ScriptManager.RegisterStartupScript(this, GetType(), "myFunction", "myFunction();", true);
1. i have setup task scheduler in windows
2. where it trigger the canvas.aspx page in every 2 min
3. on canvas.aspx page load i have applied the above solution and call it on page behind so when task scheduler call the page the it can send email to user.
-ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadString(\"www.domainname.com/pagename")"
but i noticed when i open the canvas.aspx page in browser it works well and send email to user, but when page run in task scheduler the canvas function is not firing.
so its exporting the image since its client side jquery call and in task scheduler page is running behind not actually open therefore i am assuming that jquery function is not firing through task scheduler.