mirror of
https://github.com/zadam/trilium.git
synced 2026-05-06 15:26:59 +02:00
fix(print): margins not taken into consideration
This commit is contained in:
@@ -4,9 +4,6 @@
|
||||
--print-font-size: 11pt;
|
||||
}
|
||||
|
||||
@page {
|
||||
margin: 2cm;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
|
||||
@@ -32,6 +32,14 @@ async function main() {
|
||||
|
||||
await import("./print.css");
|
||||
|
||||
// Browser printing relies on @page margins since there's no programmatic control.
|
||||
// Electron uses printToPDF() margins instead, so we only inject this for the browser path.
|
||||
if (!isElectron()) {
|
||||
const style = document.createElement("style");
|
||||
style.textContent = "@page { margin: 2cm; }";
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
|
||||
// Load the user's font preferences so that --detail-font-family is available.
|
||||
const fontLink = document.createElement("link");
|
||||
fontLink.rel = "stylesheet";
|
||||
|
||||
Reference in New Issue
Block a user