html2canvas生成图片底部白边问题

html2canvas(document.getElementById("poster-canvas-box"), {
  useCORS: true,
  height: document.getElementById("poster-canvas-box").clientHeight - 2, // canvas高度与所截图高度相同或者更小,解决底部白边问题
}).then((canvasElement) => {
  // do something
});

你可能感兴趣的:(html2canvas生成图片底部白边问题)