This commit is contained in:
2026-03-11 14:55:45 +08:00
parent 16a2e4ff09
commit 8441e66e93

View File

@@ -2241,6 +2241,23 @@
restoreBtn();
return;
}
// 调试:确认截图是否全白/是否有内容
try {
var ctx2d = canvas.getContext("2d");
if (ctx2d) {
var p = ctx2d.getImageData(0, 0, 1, 1).data;
console.info(
"PDF截图信息",
{
w: canvas.width,
h: canvas.height,
firstPixel: Array.prototype.slice.call(p),
},
);
}
} catch (e) {
console.warn("读取截图像素失败(可能被跨域资源污染)", e);
}
var imgData = canvas.toDataURL(
"image/jpeg",
0.95,