mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 20:36:13 +01:00
feat(pdf): allow changing page size via attribute
This commit is contained in:
@@ -51,6 +51,7 @@ ipcMain.on("create-extra-window", (event, arg) => {
|
||||
interface ExportAsPdfOpts {
|
||||
title: string;
|
||||
landscape: boolean;
|
||||
pageSize: "A0" | "A1" | "A2" | "A3" | "A4" | "A5" | "A6" | "Legal" | "Letter" | "Tabloid" | "Ledger";
|
||||
}
|
||||
|
||||
ipcMain.on("export-as-pdf", async (e, opts: ExportAsPdfOpts) => {
|
||||
@@ -76,6 +77,7 @@ ipcMain.on("export-as-pdf", async (e, opts: ExportAsPdfOpts) => {
|
||||
try {
|
||||
buffer = await browserWindow.webContents.printToPDF({
|
||||
landscape: opts.landscape,
|
||||
pageSize: opts.pageSize,
|
||||
generateDocumentOutline: true,
|
||||
generateTaggedPDF: true,
|
||||
displayHeaderFooter: true,
|
||||
|
||||
Reference in New Issue
Block a user