【问题标题】:Html2Canvas not rendering image properlyHtml2Canvas 无法正确渲染图像
【发布时间】: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


    【解决方案1】:

    这是因为图像损坏。 我只是正确加载图像。结果成功了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-01
      • 1970-01-01
      相关资源
      最近更新 更多