修复打印
This commit is contained in:
@@ -66,9 +66,15 @@ const UI8: React.FC = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pdfData) {
|
||||
alert("PDF 尚未加载完成,请稍候");
|
||||
return;
|
||||
}
|
||||
|
||||
setIsPrinting(true);
|
||||
try {
|
||||
const result = await window.electronAPI.printPdf(PDF_URL);
|
||||
// 使用已加载的 PDF 数据(base64),避免重复下载
|
||||
const result = await window.electronAPI.printPdf(pdfData);
|
||||
if (!result.success) {
|
||||
alert(`打印失败: ${result.error || "未知错误"}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user