This commit is contained in:
Matthias Hochmeister
2026-03-26 14:52:06 +01:00
parent 841b6e3775
commit 7b7d799238

View File

@@ -380,6 +380,7 @@ export default function BestellungDetail() {
// ── PDF Export ── // ── PDF Export ──
async function generateBestellungDetailPdf() { async function generateBestellungDetailPdf() {
if (!bestellung) return; if (!bestellung) return;
try {
const { jsPDF } = await import('jspdf'); const { jsPDF } = await import('jspdf');
const autoTable = (await import('jspdf-autotable')).default; const autoTable = (await import('jspdf-autotable')).default;
const doc = new jsPDF({ orientation: 'portrait', unit: 'mm', format: 'a4' }); const doc = new jsPDF({ orientation: 'portrait', unit: 'mm', format: 'a4' });
@@ -597,6 +598,10 @@ export default function BestellungDetail() {
doc.text(sigName, 120, curY); doc.text(sigName, 120, curY);
doc.save(`bestellung_${kennung.replace('/', '-')}.pdf`); doc.save(`bestellung_${kennung.replace('/', '-')}.pdf`);
} catch (err) {
console.error('PDF generation failed:', err);
showError('PDF konnte nicht erstellt werden');
}
} }
if (isLoading) { if (isLoading) {