feat(desktop/print): integrate for export to PDF

This commit is contained in:
Elian Doran
2025-10-19 20:23:28 +03:00
parent fb0c3be7fa
commit d1854d85ce
3 changed files with 25 additions and 15 deletions

View File

@@ -326,13 +326,14 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
}
async exportAsPdfEvent() {
if (!this.noteContext?.isActive() || !this.note) {
if (!this.noteContext?.isActive() || !this.note || !this.notePath) {
return;
}
const { ipcRenderer } = utils.dynamicRequire("electron");
ipcRenderer.send("export-as-pdf", {
title: this.note.title,
notePath: this.notePath,
pageSize: this.note.getAttributeValue("label", "printPageSize") ?? "Letter",
landscape: this.note.hasAttribute("label", "printLandscape")
});