/** * PDF form field (AcroForm) extractor. * * Extracts interactive form fields from a PDF's `/AcroForm` dictionary. * Supports all standard field types: * - **Text** (`/Tx`) — Text input fields * - **Button** (`/Btn`) — Checkboxes, radio buttons, push buttons * - **Choice** (`/Ch`) — Dropdowns (combo boxes) and list boxes * - **Signature** (`/Sig`) — Digital signature fields * * Handles field hierarchies (parent/child), inherited values, and default appearances. * * @see PDF Reference 1.7, §12.7 - Interactive Forms */ import type { PdfDocument } from "./pdf-document.js"; /** Type of form field. */ export type PdfFormFieldType = "text" | "checkbox" | "radio" | "dropdown" | "listbox" | "button" | "signature" | "unknown"; /** A single form field extracted from the PDF. */ export interface PdfFormField { /** Fully qualified field name (e.g. "form1.address.city") */ name: string; /** Field type */ type: PdfFormFieldType; /** Current value of the field */ value: string; /** Default value (/DV entry) */ defaultValue: string; /** Whether the field is read-only */ readOnly: boolean; /** Whether the field is required */ required: boolean; /** For choice fields: the list of available options */ options: string[]; /** For checkboxes/radio buttons: the export value when checked */ exportValue: string; /** Field flags (/Ff entry) — raw bit field */ flags: number; } /** * Extract form fields from a PDF document. * * Reads the `/AcroForm` dictionary from the catalog and recursively * traverses the field tree. * * @param doc - The PDF document * @returns Array of extracted form fields */ export declare function extractFormFields(doc: PdfDocument): PdfFormField[];