diff --git a/packages/core-service/src/core/expert-profile/profile-export.service.ts b/packages/core-service/src/core/expert-profile/profile-export.service.ts index 97f807d..04925b8 100644 --- a/packages/core-service/src/core/expert-profile/profile-export.service.ts +++ b/packages/core-service/src/core/expert-profile/profile-export.service.ts @@ -517,7 +517,7 @@ export class ProfileExportService { // sind Quell-Dot und Ziel-Dot auf derselben Seite → Linie korrekt. if (pendingLineStartY !== null && pendingLineEndY !== null) { if (yRight + headerH <= pageBottom) { - doc.moveTo(timelineX, pendingLineStartY + 8) + doc.moveTo(timelineX, pendingLineStartY) .lineTo(timelineX, pendingLineEndY) .strokeColor(accentColor).lineWidth(1).stroke(); } @@ -533,6 +533,7 @@ export class ProfileExportService { } let pageBreakOccurred = false; + let overflowResumeY: number | undefined; const entryStartY = yRight; // Timeline-Punkt @@ -562,6 +563,9 @@ export class ProfileExportService { if (yRight > pageBottom) { doc.addPage(); yRight = 40; + if (!pageBreakOccurred) { + overflowResumeY = yRight; + } pageBreakOccurred = true; } const raw = task.trim(); @@ -585,9 +589,15 @@ export class ProfileExportService { yRight += 12; - // Linie für nächste Iteration vormerken — nur wenn kein Seitenumbruch innerhalb des Eintrags + // Linie für nächste Iteration vormerken if (!pageBreakOccurred) { - pendingLineStartY = entryStartY; + // Normaler Fall: Linie von unterhalb des Dots bis zum Gap + pendingLineStartY = entryStartY + 8; + pendingLineEndY = yRight - 4; + } else if (overflowResumeY !== undefined) { + // Überlauf-Fall: Inhalt geht auf neuer Seite weiter. + // Timeline-Linie auf der neuen Seite vormerken (vom Seitenanfang bis zum Gap) + pendingLineStartY = overflowResumeY; pendingLineEndY = yRight - 4; } }