/** * Form field appearance stream generation. * * Generates visual appearance streams for PDF form fields so that field * values are visible in all PDF viewers — even those that do not honor * the `/NeedAppearances` flag. * * @see PDF Reference 1.7, §12.5.5 — Appearance Streams * @see PDF Reference 1.7, §12.7.4 — Field Appearance */ /** Options for generating a text field appearance stream. */ export interface TextFieldAppearanceOptions { /** The text value to display. */ value: string; /** Widget annotation rectangle [x1, y1, x2, y2]. */ rect: number[]; /** Font size in points. 0 or omitted = auto-size to fit the field height. */ fontSize?: number; /** Font resource name to reference (e.g. "Helv"). */ fontName?: string; /** Text alignment within the field. */ alignment?: "left" | "center" | "right"; } /** * Generate an appearance stream for a text form field. * * Builds a minimal content stream that clips to the widget rect and * draws the field value using the specified (or default) font. * * @returns The raw stream bytes and a resources dictionary string. */ export declare function generateTextFieldAppearance(options: TextFieldAppearanceOptions): { stream: Uint8Array; resources: string; }; /** * Generate appearance streams for a checkbox form field. * * Returns two streams: * - `streamOn`: draws a checkmark (✓-like shape) inside the rect * - `streamOff`: empty appearance (blank field) * * @param checked - Whether to generate the checked or unchecked variant * (both are always returned; `checked` is ignored — both * on and off streams are produced). * @param rect - Widget annotation rectangle [x1, y1, x2, y2]. */ export declare function generateCheckboxAppearance(_checked: boolean, rect: number[]): { streamOn: Uint8Array; streamOff: Uint8Array; }; /** * Build the BBox array string for a form XObject appearance stream. * The bounding box is in the widget's coordinate space: [0 0 width height]. */ export declare function buildAppearanceBBox(rect: number[]): string;