2
Good afternoon to all,
I’m developing an e-mail signature generator here for the service. I took a ready script that uses 'html2canvas' and 'canvas2image' to transform the code into an image and later, allow the user to save the image as .png. However, when I click on the "Save Signature" button an example of the signature appears below that 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 this script carries out the download of the file, however the same is coming without any extension,.
I appreciate all your help.
Find the download code?
– Rafael Augusto
It was commented, is this here Canvas2image.saveAsPNG(canvas);
– Otávio Capila
I took a look here in Stack and solved the problem of saving without format, it was necessary to edit the script canvas2image.js . A problem I solved,now missing to make it work on Chrome,Mozilla works perfectly.
– Otávio Capila
send the download link of this code ready
– Julio Henrique
What code are you referring to? If this is the one I put up,.
– Otávio Capila
Some light @Rafaelaugusto ?
– Otávio Capila
Must be Cors problem, please give details. It may even be CSS problem
– Guilherme Nascimento
CSS is very simple, nothing that can remove the logo from the final result.
– Otávio Capila
Problem solved.
– Otávio Capila
@Otáviocapila if the problem has been solved, please add the solution as a response.
– Woss
I don’t know the cause of the problem,but after I went up the page to production on the server,.
– Otávio Capila