@ironsoftware/ironpdf
Version:
IronPDF for Node
23 lines (18 loc) • 679 B
text/typescript
import { z } from "zod"
import {
PaperSize,
PdfPaperOrientation,
PaperSizeUnit, CustomPaperSize, PdfPaperSize
} from "../../public/paper";
export const paperSizeSchema: z.ZodType<PaperSize> = z.nativeEnum(PaperSize)
export const pdfPaperOrientationSchema: z.ZodType<PdfPaperOrientation> = z.nativeEnum(PdfPaperOrientation)
export const paperSizeUnitSchema: z.ZodType<PaperSizeUnit> = z.nativeEnum(PaperSizeUnit)
export const customPaperSizeSchema: z.ZodType<CustomPaperSize> = z.object({
width: z.number(),
height: z.number(),
unit: paperSizeUnitSchema
})
export const pdfPaperSizeSchema: z.ZodType<PdfPaperSize> = z.union([
paperSizeSchema,
customPaperSizeSchema
])