Canvas2Image Script does not work in Chome [closed]

2

Good afternoon everyone,

I'm developing an email signature generator here for the service. I got a ready script that uses the 'html2canvas' and the 'canvas2image' to turn the code into an image and then allow the user to save the image as .png. However, when I click the "Save Signature" button an example of the signature below shows that the person can select 'Save as ..' but the company logo, which is in the project folder in .png format, does not appear in the final result.

The JS code I'm using is this

$(function() { 
$("#btnSave").click(function() { 
    html2canvas($("#gerador"), {
        onrendered: function(canvas) {
            theCanvas = canvas;
            document.body.appendChild(canvas);
            var photo = canvas.toDataURL('image/png');

            //Convert and download as image 
            Canvas2Image.saveAsPNG(canvas);
            // Clean up 
            document.body.removeChild(canvas);

        }

    });
  });
}); 

I know that this script downloads the file, but it is coming without any extension, I do not know why.

Thank you for your help.

    
asked by anonymous 03.11.2017 / 16:53

0 answers