Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:loud_sound: Add logging for Unable to export the large PDF file https://github.com/siyuan-note/siyuan/issues/10982

Daniel64d02559f610
diff --git a/app/electron/main.js b/app/electron/main.js
index ee59320d16..e5663d7b46 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -773,7 +773,11 @@ app.whenReady().then(() => {
return systemPreferences.askForMediaAccess("microphone");
}
if (data.cmd === "printToPDF") {
- return getWindowByContentId(data.webContentsId).webContents.printToPDF(data.pdfOptions);
+ try {
+ return getWindowByContentId(data.webContentsId).webContents.printToPDF(data.pdfOptions);
+ } catch (e) {
+ writeLog(e);
+ }
}
if (data.cmd === "siyuan-open-file") {
let hasMatch = false;
diff --git a/app/src/boot/onGetConfig.ts b/app/src/boot/onGetConfig.ts
index b4266f3d39..db83bec186 100644
--- a/app/src/boot/onGetConfig.ts
+++ b/app/src/boot/onGetConfig.ts
@@ -334,6 +334,7 @@ ${response.data.replace("%pages", "<span class=totalPages></span>").replace("%pa
});
});
} catch (e) {
+ console.error(e);
showMessage("Export PDF failed: " + e, 0, "error", msgId);
ipcRenderer.send(Constants.SIYUAN_CMD, {cmd: "destroy", webContentsId: ipcData.webContentsId});
}