mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-25 17:34:52 +10:00
feat: implement free-form resume page formats, resolves #2991
This commit is contained in:
@@ -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 };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user