mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 12:36:57 +00:00
add vague boilerplate code for generating PDF and passing back to browser
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user