diff --git a/lib/TruckBlueprint.tsx b/lib/TruckBlueprint.tsx index b09e1f18..8516e15c 100644 --- a/lib/TruckBlueprint.tsx +++ b/lib/TruckBlueprint.tsx @@ -1,9898 +1,9933 @@ import React from 'react'; import { Svg, G, Path } from '@react-pdf/renderer'; -export const TruckBlueprint = ({ style, opacity = 1 }: { style?: any; opacity?: number }) => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const hexToRgb = (hex: string) => { + const bigint = parseInt(hex.slice(1), 16); + return [(bigint >> 16) & 255, (bigint >> 8) & 255, bigint & 255]; +}; +const getSolidHex = (fgHex: string, alpha: number, bgHex: string) => { + if (alpha >= 1) return fgHex; + const [fr, fg, fb] = hexToRgb(fgHex); + const [br, bg, bb] = hexToRgb(bgHex); + const r = Math.round(fr * alpha + br * (1 - alpha)); + const g = Math.round(fg * alpha + bg * (1 - alpha)); + const b = Math.round(fb * alpha + bb * (1 - alpha)); + return '#' + [r, g, b].map((x) => x.toString(16).padStart(2, '0')).join(''); +}; + +const getRGBA = (hex: string, alpha: number) => { + const [r, g, b] = hexToRgb(hex); + return `rgba(${r}, ${g}, ${b}, ${alpha})`; +}; + +export const TruckBlueprint = ({ + style, + opacity = 1, + backgroundColor = '#ffffff', +}: { + style?: any; + opacity?: number; + backgroundColor?: string; +}) => { + console.log( + 'TruckBlueprint rendering with opacity:', + opacity, + 'and backgroundColor:', + backgroundColor, + ); + return ( + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/lib/pdf-business-card.tsx b/lib/pdf-business-card.tsx index 0ef48b13..d534bcdb 100644 --- a/lib/pdf-business-card.tsx +++ b/lib/pdf-business-card.tsx @@ -46,6 +46,7 @@ export interface PDFBusinessCardProps { person: PersonData; qrCodeDataUrl: string; variant?: 'blue' | 'white' | 'black'; + isViaprinto?: boolean; } // Die Buchstaben K, L, Z im SVG (inklusive dem kleinen Stück vom Z oben links) @@ -178,7 +179,7 @@ const styles = StyleSheet.create({ accentLineHorizontal: { flex: 1, height: 1.5, - backgroundColor: COLORS.primary, // Brand blue line + backgroundColor: '#011dff', // Brand blue line marginLeft: 15, marginRight: 0, }, @@ -223,7 +224,7 @@ const styles = StyleSheet.create({ roleText: { fontSize: 7.5, fontWeight: 'bold', - color: COLORS.primary, + color: '#011dff', letterSpacing: 0.5, textTransform: 'uppercase', }, @@ -258,15 +259,15 @@ const styles = StyleSheet.create({ gap: 3, }, qrCodeWrapper: { - width: '13mm', - height: '13mm', + width: '11mm', + height: '11mm', }, qrCode: { width: '100%', height: '100%', }, qrLabel: { - fontSize: 4.5, + fontSize: 4, color: COLORS.neutralDark, // Subtle grey instead of loud blue fontWeight: 'bold', letterSpacing: 1.2, @@ -367,6 +368,7 @@ const VectorLogo = ({ overrideWhiteColor, pathOverrides, solidPaths, + solidBackgroundColor = '#000a66', }: { paths: { d: string; fill: string }[]; style: any; @@ -374,20 +376,25 @@ const VectorLogo = ({ overrideWhiteColor?: string; pathOverrides?: Record; solidPaths?: number[]; + solidBackgroundColor?: string; }) => ( - {paths.map((p, i) => { - let fill = overrideColor || p.fill; - let d = p.d; - - if (solidPaths && solidPaths.includes(i)) { - // Keep only the first subpath to make the shape solid (remove holes) + {/* Background layer: solid fills to prevent see-through */} + {solidPaths && + solidBackgroundColor && + paths.map((p, i) => { + if (!solidPaths.includes(i)) return null; + let d = p.d; const zIndex = d.toUpperCase().indexOf('Z'); if (zIndex !== -1) { d = d.substring(0, zIndex + 1); } - } + return ; + })} + {paths.map((p, i) => { + let fill = overrideColor || p.fill; + const d = p.d; if (pathOverrides && pathOverrides[i]) { fill = pathOverrides[i]; @@ -688,6 +695,7 @@ export const PDFBusinessCard: React.FC = ({ person, qrCodeDataUrl, variant = 'blue', + isViaprinto = false, }) => { const isWhiteVariant = variant === 'white' || variant === 'black'; @@ -737,11 +745,9 @@ export const PDFBusinessCard: React.FC = ({ > = ({ Hochspannung + = ({ - {/* Base Logo: text is white, truck is green. Make KLZ letters blend into background */} + {/* Base Logo: text is white, truck is green. Fill KLZ background to hide truck, keep outline white */} ({ ...acc, [idx]: COLORS.blue }), {})} solidPaths={KLZ_PATHS} + solidBackgroundColor={isWhiteVariant ? '#ffffff' : '#011dff'} /> {/* Letterpress Mask Layer: We use #ff00fe as a marker color. Only the "KLZ" letters! */} - KLZ_PATHS.includes(i))} - style={[styles.frontLogo, { position: 'absolute' }]} - overrideColor="#ff00fe" - solidPaths={KLZ_PATHS.map((_, i) => i)} - /> + {isViaprinto && ( + KLZ_PATHS.includes(i))} + style={[styles.frontLogo, { position: 'absolute' }]} + overrideColor="#ff00fe" + solidPaths={KLZ_PATHS.map((_, i) => i)} + /> + )} - {/* RÜCKSEITE (White page with contact info) */} + {/* VORDERSEITE (White page with contact info) */} ({ ...acc, [idx]: 'none' }), {})} /> diff --git a/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich.pdf b/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich.pdf index 49a468fb..928319ba 100644 Binary files a/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich.pdf and b/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich.pdf differ diff --git a/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich_Viaprinto_CMYK.pdf b/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich_Viaprinto_CMYK.pdf deleted file mode 100644 index 8691a8d0..00000000 Binary files a/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich_Viaprinto_CMYK.pdf and /dev/null differ diff --git a/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich_Viaprinto_CMYK_91x61mm_3mmBleed.pdf b/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich_Viaprinto_CMYK_91x61mm_3mmBleed.pdf index 0fae33c8..ff8bf509 100644 Binary files a/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich_Viaprinto_CMYK_91x61mm_3mmBleed.pdf and b/public/downloads/business-cards/KLZ_Visitenkarte_Johannes_Gleich_Viaprinto_CMYK_91x61mm_3mmBleed.pdf differ diff --git a/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel.pdf b/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel.pdf index 50eb5c7b..73228495 100644 Binary files a/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel.pdf and b/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel.pdf differ diff --git a/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel_Viaprinto_CMYK.pdf b/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel_Viaprinto_CMYK.pdf deleted file mode 100644 index eafe467b..00000000 Binary files a/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel_Viaprinto_CMYK.pdf and /dev/null differ diff --git a/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel_Viaprinto_CMYK_91x61mm_3mmBleed.pdf b/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel_Viaprinto_CMYK_91x61mm_3mmBleed.pdf index f27502f0..ffe4f3c2 100644 Binary files a/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel_Viaprinto_CMYK_91x61mm_3mmBleed.pdf and b/public/downloads/business-cards/KLZ_Visitenkarte_Klaus_Mintel_Viaprinto_CMYK_91x61mm_3mmBleed.pdf differ diff --git a/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer.pdf b/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer.pdf index c720d5d2..1425ed8d 100644 Binary files a/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer.pdf and b/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer.pdf differ diff --git a/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer_Viaprinto_CMYK.pdf b/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer_Viaprinto_CMYK.pdf deleted file mode 100644 index 38e3fb22..00000000 Binary files a/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer_Viaprinto_CMYK.pdf and /dev/null differ diff --git a/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer_Viaprinto_CMYK_91x61mm_3mmBleed.pdf b/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer_Viaprinto_CMYK_91x61mm_3mmBleed.pdf index a2eb90d8..ae649a80 100644 Binary files a/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer_Viaprinto_CMYK_91x61mm_3mmBleed.pdf and b/public/downloads/business-cards/KLZ_Visitenkarte_Michael_Bodemer_Viaprinto_CMYK_91x61mm_3mmBleed.pdf differ diff --git a/scripts/generate-business-cards.ts b/scripts/generate-business-cards.ts index 927e795c..acc6143b 100644 --- a/scripts/generate-business-cards.ts +++ b/scripts/generate-business-cards.ts @@ -19,6 +19,8 @@ const CONFIG = { truckImage: path.join(process.cwd(), 'public/truck.png'), fontRegular: path.join(process.cwd(), 'public/fonts/Inter-Regular.ttf'), fontBold: path.join(process.cwd(), 'public/fonts/Inter-Bold.ttf'), + ghostscriptScript: + '/Users/marcmintel/.gemini/config/plugins/mintel-ui-standards-plugin/skills/mintel-print-workflow/scripts/convert-cmyk.sh', }; const PEOPLE: PersonData[] = [ @@ -71,39 +73,52 @@ END:VCARD`; }); const safeName = person.name.replace(/\s+/g, '_'); - const finalFileName = `KLZ_Visitenkarte_${safeName}.pdf`; - const rgbPath = path.join(CONFIG.outputDir, `RGB_${finalFileName}`); - const finalPath = path.join(CONFIG.outputDir, finalFileName); - console.log(`- Rendering React-PDF layout (RGB ONLY, Blue Variant)...`); - const buffer = await renderToBuffer( + // 1. STANDARD DIGITAL PDF (RGB, no letterpress mask) + console.log(`- Rendering standard digital PDF (RGB ONLY, Blue Variant)...`); + const finalFileName = `KLZ_Visitenkarte_${safeName}.pdf`; + const tempFileName = `temp_${finalFileName}`; + const finalPath = path.join(CONFIG.outputDir, finalFileName); + const tempPath = path.join(CONFIG.outputDir, tempFileName); + + let buffer = await renderToBuffer( React.createElement(PDFBusinessCard, { person, qrCodeDataUrl, - variant: 'blue', // Explicitly use blue now + variant: 'blue', + isViaprinto: false, }), ); + fs.writeFileSync(tempPath, buffer); - fs.writeFileSync(rgbPath, buffer); - - console.log(`- Outlining fonts via Ghostscript (Keeping RGB)...`); - const gsCommand = `gs -dNoOutputFonts -sDEVICE=pdfwrite -o "${finalPath}" "${rgbPath}"`; - execSync(gsCommand, { stdio: 'ignore' }); - - fs.unlinkSync(rgbPath); - + // Convert fonts to outlines via ghostscript + const gsCommand = `gs -dNoOutputFonts -sDEVICE=pdfwrite -o "${finalPath}" "${tempPath}"`; + execSync(gsCommand, { stdio: 'inherit' }); + fs.unlinkSync(tempPath); console.log(`✓ Final Print File generated (Fonts to Paths, RGB preserved): ${finalFileName}`); + // 2. VIAPRINTO PDF (Letterpress mask, CMYK) + console.log(`- Rendering Viaprinto PDF (Letterpress mask)...`); + const tempViaprintoPath = path.join(CONFIG.outputDir, `temp_viaprinto_${safeName}.pdf`); + buffer = await renderToBuffer( + React.createElement(PDFBusinessCard, { + person, + qrCodeDataUrl, + variant: 'blue', + isViaprinto: true, + }), + ); + fs.writeFileSync(tempViaprintoPath, buffer); + // Convert to CMYK for Viaprinto const finalFileNameCMYK = `KLZ_Visitenkarte_${safeName}_Viaprinto_CMYK_91x61mm_3mmBleed.pdf`; const finalPathCMYK = path.join(CONFIG.outputDir, finalFileNameCMYK); console.log(`- Converting to CMYK for Viaprinto...`); - const cmykScript = - '/Users/marcmintel/.gemini/config/plugins/mintel-ui-standards-plugin/skills/mintel-print-workflow/scripts/convert-cmyk.sh'; - const cmykCommand = `bash "${cmykScript}" "${finalPath}" "${finalPathCMYK}"`; + const cmykCommand = `bash "${CONFIG.ghostscriptScript}" "${tempViaprintoPath}" "${finalPathCMYK}"`; try { - execSync(cmykCommand, { stdio: 'ignore' }); + execSync(cmykCommand, { stdio: 'inherit' }); + fs.unlinkSync(tempViaprintoPath); console.log(`✓ CMYK Print File generated: ${finalFileNameCMYK}`); } catch (e) { console.error(`❌ CMYK conversion failed! Is Ghostscript installed?`);