feat(pdf): support landscape mode at note level

This commit is contained in:
Elian Doran
2025-02-01 00:28:48 +02:00
parent 658ce103fc
commit f3a3906db7
2 changed files with 6 additions and 2 deletions

View File

@@ -50,6 +50,7 @@ ipcMain.on("create-extra-window", (event, arg) => {
interface ExportAsPdfOpts {
title: string;
landscape: boolean;
}
ipcMain.on("export-as-pdf", async (e, opts: ExportAsPdfOpts) => {
@@ -73,7 +74,9 @@ ipcMain.on("export-as-pdf", async (e, opts: ExportAsPdfOpts) => {
let buffer: Buffer;
try {
buffer = await browserWindow.webContents.printToPDF({});
buffer = await browserWindow.webContents.printToPDF({
landscape: opts.landscape
});
} catch (e) {
dialog.showErrorBox(t("pdf.unable-to-export-title"), t("pdf.unable-to-export-message"));
return;