{ "updatedAt": "2026-03-29T19:18:04.599Z", "createdAt": "2025-10-03T10:56:26.208Z", "id": "g6FDHAICnQdbW6Ye", "name": "Adressetikette erstellen", "description": null, "active": true, "isArchived": false, "nodes": [ { "parameters": { "method": "POST", "url": "http://192.168.1.199:9901/forms/chromium/convert/html", "sendBody": true, "contentType": "multipart-form-data", "bodyParameters": { "parameters": [ { "name": "Response Format", "value": "File" }, { "name": "Download File Name", "value": "Versand-Label" }, { "parameterType": "formBinaryData", "name": "index", "inputDataFieldName": "index" }, { "parameterType": "formBinaryData", "name": "styles", "inputDataFieldName": "styles" }, { "name": "preferCssPageSize", "value": "true" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 1120, 0 ], "id": "517816cc-fae4-482b-9b0b-7406c1057a3e", "name": "Gotemberg PDF", "retryOnFail": true, "maxTries": 5 }, { "parameters": { "protocol": "sftp", "operation": "upload", "path": "={{ $json.filename }}", "options": {} }, "type": "n8n-nodes-base.ftp", "typeVersion": 1, "position": [ 2000, 16 ], "id": "3ea1d6ad-e706-4677-977a-c733c8e13085", "name": "FTP", "credentials": { "sftp": { "id": "cK8t7TPPZIynTdj7", "name": "Naurua SFTP Account" } } }, { "parameters": { "method": "POST", "url": "http://192.168.1.199:9902/convert", "sendBody": true, "contentType": "multipart-form-data", "bodyParameters": { "parameters": [ { "parameterType": "formBinaryData", "name": "file", "inputDataFieldName": "data" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 1376, 0 ], "id": "b64e3c18-a06c-4c64-9c0b-11f0fe71e45c", "name": "pdf2png" }, { "parameters": { "jsCode": "// --- Node-Namen anpassen, falls sie bei dir anders heißen ---\nconst ORDER_NODE = 'Bestellung laden';\nconst ADDRESS_NODE = 'Versandadresse laden';\n\n// kleine Helfer\nconst get = (fn, dflt = undefined) => {\n try { return fn(); } catch { return dflt; }\n};\nconst sanitize = (s) => String(s ?? '')\n .normalize('NFKD').replace(/[\\u0300-\\u036f]/g, '') // Akzente entfernen\n .replace(/[^A-Za-z0-9_-]+/g, '_') // nur sichere Zeichen\n .replace(/^_+|_+$/g, ''); // Trim underscores\n\n// Werte aus anderen Nodes holen (Fallback: aktuelles $json)\nconst createdAtRaw = get(() => $node[ORDER_NODE].json.CreatedAt, $json.CreatedAt);\nconst bestellnummer = get(() => $node[ORDER_NODE].json.Bestellnummer, $json.Bestellnummer);\nconst vorname = get(() => $node[ADDRESS_NODE].json.Vorname, $json.Vorname);\nconst nachname = get(() => $node[ADDRESS_NODE].json.Nachname, $json.Nachname);\n\n// Datum -> YYYYMMDD\nconst dt = createdAtRaw ? new Date(createdAtRaw) : new Date();\nconst yyyymmdd = dt.toISOString().slice(0,10).replace(/-/g, '');\n\n// Dateiname bauen\nconst filename = `${yyyymmdd}_${sanitize(bestellnummer)}_${sanitize(vorname)}_${sanitize(nachname)}.png`;\n\n// Binary-Key ermitteln (meist \"data\")\nconst binKeys = Object.keys($binary || {});\nconst binKey = binKeys[0] || 'data';\n\n// Item zurückgeben, Binary-Dateiname überschreiben\nreturn {\n json: { filename },\n binary: {\n ...$binary,\n [binKey]: { ...$binary[binKey], fileName: filename }\n }\n};" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1600, 112 ], "id": "9f55cde9-8743-4ea8-be0e-c07991e4cf96", "name": "png umbenennen" }, { "parameters": { "jsCode": "// INPUT: item.json mit Feldern (Vorname, Nachname, …)\n// OUTPUT: binary.index (HTML), binary.styles (CSS)\n\n// — Layout-Parameter —\nconst WIDTH_MM = 60, HEIGHT_MM = 50;\nconst MARGIN = { top: 10, right: 5, bottom: 5, left: 10 };\nconst FONT_FAMILY = \"AvenirCustom\"; // frei wählbar, unten in @font-face + body benutzen\nconst FONT_SIZE_PT = 11;\nconst LINE_HEIGHT = 1; // realistisch, 0.2 wäre praktisch ohne Zeilenabstand\n\n// — Font-Pfad im Gotenberg-Container (über docker-compose gemountet) —\nconst FONT_PATH = \"file:///usr/local/fonts/avenir-regular.woff2\";\n\nconst d = $json;\n\nconst html = `\n
\n \n \n\n