feat: Add white and black color variants for business cards with precise SVG fills
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 15s
Build & Deploy / 🧪 QA (push) Failing after 1m27s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 4s

This commit is contained in:
2026-06-11 11:54:30 +02:00
parent 6214678433
commit 428b223020
15 changed files with 124 additions and 37 deletions

View File

@@ -103,7 +103,7 @@ END:VCARD`;
React.createElement(PDFBusinessCard, {
person,
qrCodeDataUrl,
isWhiteVariant: true,
variant: 'white',
}),
);
@@ -113,6 +113,27 @@ END:VCARD`;
execSync(gsCommandWhite, { stdio: 'ignore' });
fs.unlinkSync(rgbPathWhite);
console.log(`✓ White Variant generated: ${finalFileNameWhite}`);
// Generate Black Variant
const finalFileNameBlack = `KLZ_Visitenkarte_${safeName}_Black.pdf`;
const rgbPathBlack = path.join(CONFIG.outputDir, `RGB_${finalFileNameBlack}`);
const finalPathBlack = path.join(CONFIG.outputDir, finalFileNameBlack);
console.log(`- Rendering Black Variant...`);
const bufferBlack = await renderToBuffer(
React.createElement(PDFBusinessCard, {
person,
qrCodeDataUrl,
variant: 'black',
}),
);
fs.writeFileSync(rgbPathBlack, bufferBlack);
const gsCommandBlack = `gs -dNoOutputFonts -sDEVICE=pdfwrite -o "${finalPathBlack}" "${rgbPathBlack}"`;
execSync(gsCommandBlack, { stdio: 'ignore' });
fs.unlinkSync(rgbPathBlack);
console.log(`✓ Black Variant generated: ${finalFileNameBlack}`);
}
}