带有html2canvas的Laravel无法保存图像

时间:2020-03-29 23:20:13

标签: javascript laravel html2canvas

我想使用Html2canvas拍摄div的屏幕截图。它不会在控制台中引发任何错误,而只会提供一个空的画布。

html2canvas(document.querySelector("#myId"), {
    async: true,
    logging: false,
    backgroundColor: null,
    allowTaint: true,
    foreignObjectRendering: true,
    removeContainer: true
}).then(canvas => {
    var dataURL = canvas.toDataURL();
    window.open(dataURL);
});

我尝试了logging: true allowTaint: true useCORS: true,但是没有用

1 个答案:

答案 0 :(得分:0)

删除foreignObjectRendering,然后重试

相关问题