Error taking Html2Canvas screenshot

0
0

Hi guys,

I have been testing an application with a Canvas control. The user signs in teh canvas and with the click of a Submit button, the user’s signature is supposed to be saved as a picture in the file system. It all works as expected on my  developing machine. However, when I deployed on the production iis and tested from a client machine, I het the error  shown in the attached picture.

The code in the Submit_Click is:

======================================================================================================

private void _btnSubmit_Click(object sender, EventArgs e)
{
var error = String.Empty;

_chbConsent.Invalid = !_chbConsent.Checked;

var inputInValid = _chbConsent.Invalid;

if (inputInValid)
{
error = “Fill all the mandatory information marked in red.”;
MyShow.ErrorAlert(error);
return;
}

var appSettings = Application.Services.GetService<ApplicationSettings>();

var path = Path.Combine(appSettings.ContentRootPath, “StaticFiles”, “Signatures”, VisitId + “.bmp”);

Html2Canvas.Screenshot(this.canvas1, (image) =>
{
try
{
image.Save(path);
Application.OpenWindow($”{Application.StartupUrl}?type=thanks”, “VisitorConsent”, “resizable=0, fullscreen, top=100, screenX=3000, width=800, height=1200”, null);
}
catch (Exception ex)
{
error += ex.ToString();
if (!String.IsNullOrEmpty(error))
MyShow.ErrorAlert(error);
}
});
}
=======================================================================================

Any ideas what this “widget not found: id_16; function: screenshot” might be?

Alex

Attachment
  • You must to post comments
0
0

Hi again,

It looks like the deployment method makes the difference. It all works correctly if I publish the usual way with all the dlls included. And it does not if I publish as a single file (exe).
Have a look and see the difference in
https://win1-dev.mobics.gr/canvaswisejdll/ and

https://win1-dev.mobics.gr/canvaswisej/

It’s the same application deployed in the two different ways. just drag the mouse over tha canvas and then press the save to file button. In the second case you can see the missing widget error.

It looks like the Html2Canvas extension is missing from the single file deployment.

Regards,
Alex

 

  • You must to post comments
0
0

Hi Alaa,

I cannot install the application on a different server, since it has to access a local netwoark database to start. If this helps, it looks like the html2canvas widget does not get created, have a look at the screenshot. Could it be that its creation needs to access some internet resources?

Best,
Alex

  • You must to post comments
0
0

Hi Alaa,

Unfortunately it is deployed on a server not accessing the internet. I’ll try to deploy it to an internet facing one and let you know.

Thanks,
Alex

  • You must to post comments
0
0

Hi Alex,

Would it be possible to email us a link to the deployed application for us to debug?

Best,
Alaa

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.