feat: implement free-form resume page formats, resolves #2991

This commit is contained in:
Amruth Pillai
2026-05-08 11:28:18 +02:00
parent 9cbb30d3ba
commit 2cd774dab7
94 changed files with 860 additions and 443 deletions
+18 -2
View File
@@ -1,4 +1,20 @@
import type { Style } from "@react-pdf/types";
import type { ResumeData } from "@reactive-resume/schema/resume/data";
export const getTemplatePageSize = (format: ResumeData["metadata"]["page"]["format"]) =>
format === "letter" ? "LETTER" : "A4";
const A4_PAGE_SIZE = {
width: 595.28,
height: 841.89,
} as const;
export const getTemplatePageSize = (format: ResumeData["metadata"]["page"]["format"]) => {
if (format === "free-form") return { width: A4_PAGE_SIZE.width };
if (format === "letter") return "LETTER";
return "A4";
};
export const getTemplatePageMinHeightStyle = (format: ResumeData["metadata"]["page"]["format"]): Style | undefined => {
if (format !== "free-form") return undefined;
return { minHeight: A4_PAGE_SIZE.height };
};