add vague boilerplate code for generating PDF and passing back to browser

This commit is contained in:
2025-12-10 16:16:01 +01:00
parent 432baf4c7c
commit b73ec6afc0
5 changed files with 480 additions and 6 deletions
+18
View File
@@ -8,6 +8,24 @@ export const generateFeuilleDeMatch = actionClient
.action(async ({ parsedInput }) => {
try {
console.log("generateFeuilleDeMatch", parsedInput);
// console.log("Generating PDF for:", parsedInput.competition);
//
// // 1. Render PDF to Node Stream
// const stream = await renderToStream(FeuilleMatchPdf({ data: parsedInput }));
//
// // 2. Convert Stream to Buffer
// const chunks: Buffer[] = [];
// for await (const chunk of stream) {
// chunks.push(Buffer.from(chunk));
// }
// const pdfBuffer = Buffer.concat(chunks);
//
// // 3. Return Base64 String
// return {
// pdfBase64: pdfBuffer.toString('base64'),
// filename: `match_${parsedInput.competition}_${parsedInput.ronde}.pdf`
// };
} catch (error) {
console.log(error);
throw error;