html2canvas not capturing image

≯℡__Kan透↙ 提交于 2019-12-09 16:11:56

问题


html2canvas.js not capturing image. it leaves white space where the image occurs.

function capture()
{
    html2canvas(document.body, {
        allowTaint: true,
        logging:true,
        onrendered: function(canvas) {
        imagestring = canvas.toDataURL("image/png");
        console.log(imagestring);
        document.body.appendChild(canvas);
        }
    });
}

I have tried a lot but i cannot find solution .

Help is appreciated :)


回答1:


It works, when I host it in the server. The security restrictions causes it to fail.



来源:https://stackoverflow.com/questions/27754544/html2canvas-not-capturing-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!