CV: enlarge photo 20%, drop header rule above Profil
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+5
-4
@@ -664,11 +664,12 @@ function composeCvHeader(doc, S, dry, cur, header, titel, foto) {
|
||||
|
||||
// Optional applicant photo (top-right). Fit a portrait frame preserving
|
||||
// aspect ratio; a thin hairline border gives it a clean edge on white.
|
||||
const PHOTO_W = 36, PHOTO_H = 40; // mm (frame cap; 20% larger than 30x40)
|
||||
let photoOk = false, photoW = 0, photoH = 0;
|
||||
if (foto && foto.dataUrl) {
|
||||
try {
|
||||
const props = doc.getImageProperties(foto.dataUrl);
|
||||
const maxW = 30 * S, maxH = 40 * S;
|
||||
const maxW = PHOTO_W * S, maxH = PHOTO_H * S;
|
||||
photoW = maxW;
|
||||
photoH = photoW * props.height / props.width;
|
||||
if (photoH > maxH) { photoH = maxH; photoW = photoH * props.width / props.height; }
|
||||
@@ -676,7 +677,7 @@ function composeCvHeader(doc, S, dry, cur, header, titel, foto) {
|
||||
} catch (e) { photoOk = false; }
|
||||
}
|
||||
|
||||
const leftW = photoOk ? (RV_W - 30 * S - 6 * S) : RV_W * 0.62;
|
||||
const leftW = photoOk ? (RV_W - PHOTO_W * S - 6 * S) : RV_W * 0.62;
|
||||
write(doc, S, dry, cur, header.name, { pt: 22, style: 'bold', color: RC.ink, x: RV.mx, width: leftW, factor: 1.05 });
|
||||
if (titel) write(doc, S, dry, cur, titel, { pt: 12, color: RC.sub, x: RV.mx, width: leftW, factor: 1.15 });
|
||||
if (header.geburtsdatum) write(doc, S, dry, cur, `Geburtsdatum: ${header.geburtsdatum}`, { pt: 9, color: RC.sub, x: RV.mx, width: leftW, factor: 1.3 });
|
||||
@@ -702,8 +703,8 @@ function composeCvHeader(doc, S, dry, cur, header, titel, foto) {
|
||||
cur.y = Math.max(leftBottom, rc.y) + 3.2 * S;
|
||||
}
|
||||
|
||||
rule(doc, S, dry, cur.y, RV.mx, RV_R, RC.ink, 0.6);
|
||||
cur.y += 5 * S;
|
||||
// No separator rule above the first section (Profil) — cleaner modern head.
|
||||
cur.y += 2.5 * S;
|
||||
}
|
||||
|
||||
function composeCV(doc, S, dry, cur, { cv, header, titel, foto }) {
|
||||
|
||||
Reference in New Issue
Block a user