mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
desktop app(export pdf): add page numbering
This commit is contained in:
parent
50514e2418
commit
a1dfeb14e1
@ -75,7 +75,14 @@ ipcMain.on("export-as-pdf", async (e, opts: ExportAsPdfOpts) => {
|
|||||||
let buffer: Buffer;
|
let buffer: Buffer;
|
||||||
try {
|
try {
|
||||||
buffer = await browserWindow.webContents.printToPDF({
|
buffer = await browserWindow.webContents.printToPDF({
|
||||||
landscape: opts.landscape
|
landscape: opts.landscape,
|
||||||
|
displayHeaderFooter: true,
|
||||||
|
headerTemplate: `<div></div>`,
|
||||||
|
footerTemplate: `
|
||||||
|
<div style="width: 100%; text-align: center; font-size: 10pt;">
|
||||||
|
<span class="pageNumber"></span>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dialog.showErrorBox(t("pdf.unable-to-export-title"), t("pdf.unable-to-export-message"));
|
dialog.showErrorBox(t("pdf.unable-to-export-title"), t("pdf.unable-to-export-message"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user