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 c8c28d0..106f1ac 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 @@ -313,7 +313,48 @@ export class ProfileExportService { } } - // --- FÄHIGKEITEN (linke Spalte, nach Erfahrungen) --- + // --- ZERTIFIZIERUNGEN (linke Spalte, nach Erfahrungen) --- + if (profile && profile.certifications.length > 0) { + yLeft += 6; + yLeft = this.pdfSectionTitle(doc, 'ZERTIFIZIERUNGEN', leftColX, yLeft, leftColWidth, accentColor); + + const certTimelineX = leftColX + 6; + const certContentX = leftColX + 14; + const certContentWidth = leftColWidth - 14; + + for (let i = 0; i < profile.certifications.length; i++) { + const cert = profile.certifications[i]; + const certEntryStartY = yLeft; + + // Timeline-Punkt + doc.circle(certTimelineX, certEntryStartY + 4, 3.5).fill(accentColor); + + // Jahr (fett) + doc.font('Helvetica-Bold').fontSize(8).fillColor('#555555'); + doc.text(String(cert.issueYear), certContentX, yLeft, { width: certContentWidth }); + yLeft += 11; + + // Titel + doc.font('Helvetica-Bold').fontSize(9).fillColor(accentColor); + doc.text(cert.title, certContentX, yLeft, { width: certContentWidth }); + yLeft += doc.heightOfString(cert.title, { width: certContentWidth }) + 2; + + // Zertifizierungsstelle + doc.font('Helvetica').fontSize(8).fillColor('#555555'); + doc.text(cert.issuingBody, certContentX, yLeft, { width: certContentWidth }); + yLeft += 11; + + yLeft += 4; + + // Timeline-Linie (korrekte Länge) + if (i < profile.certifications.length - 1) { + doc.moveTo(certTimelineX, certEntryStartY + 8).lineTo(certTimelineX, yLeft - 4) + .strokeColor(accentColor).lineWidth(1).stroke(); + } + } + } + + // --- FÄHIGKEITEN (linke Spalte, nach Zertifizierungen) --- if (profile && profile.skills.length > 0) { yLeft += 6; yLeft = this.pdfSectionTitle(doc, 'FÄHIGKEITEN', leftColX, yLeft, leftColWidth, accentColor); @@ -414,55 +455,6 @@ export class ProfileExportService { } } - // --- ZERTIFIZIERUNGEN (rechte Spalte) --- - if (profile && profile.certifications.length > 0) { - if (yRight > pageBottom - 80) { - doc.addPage(); - yRight = 40; - } else { - yRight += 15; - } - - yRight = this.pdfSectionTitle(doc, 'ZERTIFIZIERUNGEN', rightColX, yRight, rightColWidth, accentColor); - - const certTimelineX = rightColX + 6; - const certContentX = rightColX + 18; - const certContentWidth = rightColWidth - 18; - - for (let i = 0; i < profile.certifications.length; i++) { - const cert = profile.certifications[i]; - - if (yRight > pageBottom) { - doc.addPage(); - yRight = 40; - } - - // Timeline-Punkt - doc.circle(certTimelineX, yRight + 4, 3.5).fill(accentColor); - if (i < profile.certifications.length - 1) { - doc.moveTo(certTimelineX, yRight + 8).lineTo(certTimelineX, yRight + 32) - .strokeColor(accentColor).lineWidth(1).stroke(); - } - - // Jahr (fett) - doc.font('Helvetica-Bold').fontSize(8).fillColor('#555555'); - doc.text(String(cert.issueYear), certContentX, yRight, { width: certContentWidth }); - yRight += 11; - - // Titel - doc.font('Helvetica-Bold').fontSize(9).fillColor(accentColor); - doc.text(cert.title, certContentX, yRight, { width: certContentWidth }); - yRight += doc.heightOfString(cert.title, { width: certContentWidth }) + 2; - - // Zertifizierungsstelle - doc.font('Helvetica').fontSize(8).fillColor('#555555'); - doc.text(cert.issuingBody, certContentX, yRight, { width: certContentWidth }); - yRight += 11; - - yRight += 4; - } - } - // --- ANHÄNGE (Bild-Anhänge als zusätzliche Seiten) --- const attachments = profile?.attachments ?? []; for (const att of attachments) {