feat: generate only white variant by default and automatically build CMYK version for Viaprinto
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 19s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 19s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -75,11 +75,12 @@ END:VCARD`;
|
|||||||
const rgbPath = path.join(CONFIG.outputDir, `RGB_${finalFileName}`);
|
const rgbPath = path.join(CONFIG.outputDir, `RGB_${finalFileName}`);
|
||||||
const finalPath = path.join(CONFIG.outputDir, finalFileName);
|
const finalPath = path.join(CONFIG.outputDir, finalFileName);
|
||||||
|
|
||||||
console.log(`- Rendering React-PDF layout (RGB ONLY)...`);
|
console.log(`- Rendering React-PDF layout (RGB ONLY, White Variant)...`);
|
||||||
const buffer = await renderToBuffer(
|
const buffer = await renderToBuffer(
|
||||||
React.createElement(PDFBusinessCard, {
|
React.createElement(PDFBusinessCard, {
|
||||||
person,
|
person,
|
||||||
qrCodeDataUrl,
|
qrCodeDataUrl,
|
||||||
|
variant: 'white', // We only use the white variant now
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -93,47 +94,20 @@ END:VCARD`;
|
|||||||
|
|
||||||
console.log(`✓ Final Print File generated (Fonts to Paths, RGB preserved): ${finalFileName}`);
|
console.log(`✓ Final Print File generated (Fonts to Paths, RGB preserved): ${finalFileName}`);
|
||||||
|
|
||||||
// Generate White Variant
|
// Convert to CMYK for Viaprinto
|
||||||
const finalFileNameWhite = `KLZ_Visitenkarte_${safeName}_White.pdf`;
|
const finalFileNameCMYK = `KLZ_Visitenkarte_${safeName}_Viaprinto_CMYK.pdf`;
|
||||||
const rgbPathWhite = path.join(CONFIG.outputDir, `RGB_${finalFileNameWhite}`);
|
const finalPathCMYK = path.join(CONFIG.outputDir, finalFileNameCMYK);
|
||||||
const finalPathWhite = path.join(CONFIG.outputDir, finalFileNameWhite);
|
|
||||||
|
|
||||||
console.log(`- Rendering White Variant...`);
|
console.log(`- Converting to CMYK for Viaprinto...`);
|
||||||
const bufferWhite = await renderToBuffer(
|
const cmykScript =
|
||||||
React.createElement(PDFBusinessCard, {
|
'/Users/marcmintel/.gemini/config/plugins/mintel-ui-standards-plugin/skills/mintel-print-workflow/scripts/convert-cmyk.sh';
|
||||||
person,
|
const cmykCommand = `bash "${cmykScript}" "${finalPath}" "${finalPathCMYK}"`;
|
||||||
qrCodeDataUrl,
|
try {
|
||||||
variant: 'white',
|
execSync(cmykCommand, { stdio: 'ignore' });
|
||||||
}),
|
console.log(`✓ CMYK Print File generated: ${finalFileNameCMYK}`);
|
||||||
);
|
} catch (e) {
|
||||||
|
console.error(`❌ CMYK conversion failed! Is Ghostscript installed?`);
|
||||||
fs.writeFileSync(rgbPathWhite, bufferWhite);
|
}
|
||||||
|
|
||||||
const gsCommandWhite = `gs -dNoOutputFonts -sDEVICE=pdfwrite -o "${finalPathWhite}" "${rgbPathWhite}"`;
|
|
||||||
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}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user