// pdf.js — renders a branded, signed document (Einwilligung / Behandlungsvertrag) to // PDF using Electron's own printToPDF, no extra PDF library needed. A hidden // BrowserWindow loads a self-contained HTML string (logo and signature inlined as // base64 data URIs — a data: page can't reliably load file:// resources) and prints it. "use strict"; const { BrowserWindow } = require("electron"); function escapeHtml(s) { return String(s ?? "").replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ }[c])); } async function renderPdf({ title, ownerBlockHtml, bodyHtml, signatureDataUri, signedInfoHtml, logoDataUri }) { const html = `