fix: pdf printing with puppeteer

This commit is contained in:
Julian Krauser 2024-12-21 10:18:07 +01:00
parent 4385b6dc34
commit 98477eafde
6 changed files with 1023 additions and 733 deletions

View file

@ -231,7 +231,10 @@ export async function createProtocolPrintoutById(req: Request, res: Response): P
year: "numeric",
})}`;
let filename = `P_${protocol.title.replace(/[^a-zA-Z0-9]/g, "")}_${iteration + 1}_${new Date().toLocaleDateString()}`;
let filename = `${new Date().toISOString().split("T")[0]}_${iteration + 1}_Protokoll_${protocol.title.replace(
/[^a-zA-Z0-9]/g,
""
)}`;
await PdfExport.renderFile({
template: "protocol.template.html",