UNPKG

printmaker

Version:

Generate PDF documents and from JavaScript objects

24 lines (23 loc) 742 B
import { PDFDocument, PDFFont } from 'pdf-lib'; import { Obj } from './types.js'; export declare type FontDef = { name: string; italic?: boolean; bold?: boolean; data: string | Uint8Array | ArrayBuffer; }; export declare type Font = { name: string; italic?: boolean; bold?: boolean; pdfFont: PDFFont; }; export declare type FontSelector = { fontFamily?: string; italic?: boolean; bold?: boolean; }; export declare function parseFonts(input: unknown): FontDef[]; export declare function parseFont(def: Obj): Partial<FontDef>; export declare function embedFonts(fontDefs: FontDef[], doc: PDFDocument): Promise<Font[]>; export declare function selectFont(fonts: Font[], attrs: FontSelector): PDFFont;