【发布时间】:2021-07-01 21:20:05
【问题描述】:
这是我的代码,我没有得到正确的图像,特别是在 Crome 中。
function capture(){
html2canvas(document.querySelector(".pc_table"), {
logging: true,
letterRendering: 1,
allowTaint: true,
useCORS: true
}).then(canvas => {
console.log(canvas.toDataURL("image/jpeg", 0.9));
})
}
有时图像渲染正确(URL:https://www.gadgetlnn.com.bd/index.php?route=product/pcbuilder)点击捕获,但大多数图像就像 我尝试了很多东西,例如: https://github.com/niklasvh/html2canvas/issues/722 但没有任何工作正常。任何帮助将不胜感激。
【问题讨论】:
标签: javascript php html2canvas