This commit is contained in:
seb
2026-10-17 22:26:02 +02:00
parent 1778815a1e
commit 4bd977ed12

View File

@@ -248,6 +248,12 @@ export function generateManifestPdf({
.fillColor(secondaryColor)
.text(config.docTitle, 350, y, { align: 'right', width: 200 });
if (type === 'delivery') {
try {
doc.initForm();
} catch (_) { }
}
y += 24;
// Company subline
@@ -581,12 +587,25 @@ export function generateManifestPdf({
doc.font('Helvetica').fontSize(7.5).fillColor(textColor)
.text(nameText, colDeliv.name, y + 6, { width: colDeliv.nameW });
// 7. Checkbox outline (to cross with pencil) - left of geliefert
// 7. Checkbox (interactive PDF form field, checkable in PDF Reader)
doc.rect(colDeliv.check + 3, centerY - 1, 12, 12)
.strokeColor('#64748b')
.lineWidth(0.8)
.stroke();
try {
const checkFieldName = `check_${line.id ? line.id : index + 1}`;
doc.formCheckbox(checkFieldName, colDeliv.check + 3, centerY - 1, 12, 12, {
borderColor: '#64748b',
backgroundColor: '#ffffff',
});
const lastAnnot = doc.page.annotations[doc.page.annotations.length - 1];
if (lastAnnot?.data) {
lastAnnot.data.AS = 'Off';
lastAnnot.data.V = 'Off';
}
} catch (_) { }
// 8. Menge geliefert
doc.font('Helvetica-Bold').fontSize(8).fillColor(textColor)
.text(formatQuantity(amount) + ' Stk', colDeliv.deliv, y + 12, { width: colDeliv.delivW, align: 'right' });