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

This commit is contained in:
Daniel 2024-10-13 20:10:41 +08:00
parent 44226fe79d
commit 64d02559f6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 6 additions and 1 deletions

View file

@ -773,7 +773,11 @@ app.whenReady().then(() => {
return systemPreferences.askForMediaAccess("microphone"); return systemPreferences.askForMediaAccess("microphone");
} }
if (data.cmd === "printToPDF") { 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") { if (data.cmd === "siyuan-open-file") {
let hasMatch = false; let hasMatch = false;

View file

@ -334,6 +334,7 @@ ${response.data.replace("%pages", "<span class=totalPages></span>").replace("%pa
}); });
}); });
} catch (e) { } catch (e) {
console.error(e);
showMessage("Export PDF failed: " + e, 0, "error", msgId); showMessage("Export PDF failed: " + e, 0, "error", msgId);
ipcRenderer.send(Constants.SIYUAN_CMD, {cmd: "destroy", webContentsId: ipcData.webContentsId}); ipcRenderer.send(Constants.SIYUAN_CMD, {cmd: "destroy", webContentsId: ipcData.webContentsId});
} }