New Feature: Free-Form Page Formats for PDFs (#2595)

This commit is contained in:
Amruth Pillai
2026-01-25 23:39:16 +01:00
committed by GitHub
parent 4b2e3c0ded
commit 3a9d2e7652
68 changed files with 1053 additions and 277 deletions
+8
View File
@@ -7,6 +7,10 @@ export const pageDimensionsAsPixels = {
width: 816,
height: 1056,
},
"free-form": {
width: 794,
height: 1123, // used as minimum height
},
} as const;
export const pageDimensionsAsMillimeters = {
@@ -18,4 +22,8 @@ export const pageDimensionsAsMillimeters = {
width: "216mm",
height: "279mm",
},
"free-form": {
width: "210mm",
height: "297mm", // used as minimum height
},
} as const;
+4 -1
View File
@@ -390,7 +390,10 @@ export const pageSchema = z.object({
gapY: z.number().min(0).describe("The vertical gap between the sections of the page, defined in points (pt)."),
marginX: z.number().min(0).describe("The horizontal margin of the page, defined in points (pt)."),
marginY: z.number().min(0).describe("The vertical margin of the page, defined in points (pt)."),
format: z.enum(["a4", "letter"]).describe("The format of the page. Can be 'a4' or 'letter'."),
format: z
.enum(["a4", "letter", "free-form"])
.describe("The format of the page. Can be 'a4', 'letter' or 'free-form'.")
.catch("a4"),
locale: z
.string()
.describe("The locale of the page. Used for displaying pre-translated section headings, if not overridden.")