mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 05:46:10 +01:00
feat(pdf): support landscape mode at note level
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user