mirror of
http://172.20.10.11:3000/gitadmin/INSIGHT-MVP.git
synced 2026-06-25 00:16:41 +02:00
fix: exakte Header-Höhe für Timeline-Linie prüfen statt fester 40px-Schwelle
Berechnet die tatsächliche Mindesthöhe des nächsten Projekteintrags (Datum + Rolle + Firma) identisch zur Seitenumbruch-Logik. Verhindert hängende Linien wenn der nächste Header > 40px hoch ist und eine neue Seite benötigt. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
bec770c6ba
commit
fb57f5a4dc
1 changed files with 18 additions and 4 deletions
|
|
@ -568,13 +568,27 @@ export class ProfileExportService {
|
|||
yRight += 12;
|
||||
|
||||
// Timeline-Linie: nur zeichnen wenn kein Seitenumbruch im Eintrag
|
||||
// UND der nächste Eintrag noch auf dieser Seite passt (kein hängender Strich)
|
||||
if (i < profile.projects.length - 1 && !pageBreakOccurred && yRight + 40 <= pageBottom) {
|
||||
// UND der nächste Eintrag noch auf dieser Seite passt (exakte Header-Höhe prüfen)
|
||||
if (i < profile.projects.length - 1 && !pageBreakOccurred) {
|
||||
const nextProj = profile.projects[i + 1];
|
||||
const nextRoleText = this.sanitizePdfText(nextProj.role);
|
||||
const nextCompanyLine = nextProj.company
|
||||
? this.sanitizePdfText([nextProj.company, nextProj.industry].filter(Boolean).join(' \u00b7 '))
|
||||
: '';
|
||||
doc.font('Helvetica-Bold').fontSize(10);
|
||||
const nextRoleH = doc.heightOfString(nextRoleText, { width: contentWidth });
|
||||
doc.fontSize(9);
|
||||
const nextCompanyH = nextCompanyLine
|
||||
? doc.heightOfString(nextCompanyLine, { width: contentWidth }) + 2
|
||||
: 0;
|
||||
const nextHeaderH = 14 + nextRoleH + 2 + nextCompanyH + 8;
|
||||
if (yRight + nextHeaderH <= pageBottom) {
|
||||
doc.moveTo(timelineX, entryStartY + 8).lineTo(timelineX, yRight - 4)
|
||||
.strokeColor(accentColor).lineWidth(1).stroke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- BILD-ANHÄNGE als zusätzliche Seiten (nur Bilder — PDFs werden per pdf-lib gemerged) ---
|
||||
const attachments = profile?.attachments ?? [];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue