0
I integrated my system to generate an image from a certain table. But every time I click on "Generate Image" a different image appears (images below, the first one is correct, as it should always be). Is there a problem with my JS or HTML? If you need more details about CSS, just let me know. The version that I use HTML2CANVAS is 1.0.0-rc.7 Because every time I click on generate image it brings a different result?? Using Chrome and Edge, both updated, the same problem. No error in console.
JS:
function gerarImagem() {
html2canvas(document.querySelector("#prog_gd")).then(canvas => {
window.open().document.write('<img src="' + canvas.toDataURL() + '" />');
});
}
Hello, Evandro. Good to summarize, I indirectly participated in the html2canvas project, collaborating with the repository and creating some of the proxies to prevent "Taint", what I ask you to help is that you should [Edit] and add a [mcve] and must explain clear form and lens. It should also inform the browser and operating system where the crash occurred. Reinforcement saying, without a minimal and reproducible example we can not test.
– Guilherme Nascimento
To better enjoy the site, understand and avoid closures is worth reading the Stack Overflow Survival Guide in English.
– Guilherme Nascimento
Hello, I really do not understand why the question has been closed. It is well exemplified, including with photos. I just wanted to understand why sometimes Html2canvas works and sometimes not, bringing the rendering incorrectly. If I click several times, each time brings a different result.
– EvandroPH
Hello Evandro, the instructions are in the first comment. We have no way to analyze without you providing a [mcve], I recommend you follow the tips, so we can have a north to know where to start helping you. As I said I supported the html2canvas project and I have experience, but I need something I can put into practice to understand how the specific flaw occurs in your project. Thank you for understanding.
– Guilherme Nascimento