Asks the main process to render the current note as a PDF and return the resulting bytes for the in-app preview. Result is delivered via onExportAsPdfPreviewResult.
Returns the list of printers known to the OS.
Subscribes to the result of an exportAsPdfPreview call.
Subscribes to the "print finished" event, fired once the OS print job is dispatched.
Subscribes to progress updates emitted by the main process during a print
or PDF export run. action describes the current stage (e.g. "rendering").
Sends the previewed PDF to the OS print dialog with the given options.
Removes the listener registered via onExportAsPdfPreviewResult.
Removes all listeners registered via onPrintProgress and onPrintDone.
Persists a previously generated PDF buffer to disk via the native save
dialog. title is used as the suggested filename.
Reports rendering progress (0..100) from the renderer to the main process.
Printing and PDF export flow. Trilium drives Electron's printing pipeline through a small state machine that the main process owns, with progress and results pushed back to the renderer via IPC events.