/** * PDF Form Extractor (INT-017) * * Extracts fillable form fields from PDFs using pdf-lib for AcroForm access * and pdf-parse for text extraction. Integrates with language-aware extraction * for multi-language form support. * * @example * ```typescript * import { extractPDFFormFields, createPDFFormExtractor } from 'llm-browser/sdk'; * * // Quick extraction from URL * const result = await extractPDFFormFields('https://example.gov/form.pdf'); * console.log(`Found ${result.fields.length} form fields`); * * // With options * const result2 = await extractPDFFormFields(pdfBuffer, { * language: 'es', * extractDocumentRequirements: true, * groupIntoSections: true, * }); * * // Using extractor class for caching * const extractor = createPDFFormExtractor(); * const result3 = await extractor.extract(pdfBuffer); * ``` */ import type { PDFFormExtractionResult, PDFFormExtractionOptions } from '../types/pdf-forms.js'; /** * Extracts form fields and document requirements from PDF files. * Uses pdf-lib for AcroForm field extraction and pdf-parse for text content. */ export declare class PDFFormExtractor { private cache; /** * Extract form fields and requirements from a PDF buffer */ extract(pdfBuffer: Buffer, options?: PDFFormExtractionOptions): Promise; /** * Convert a pdf-lib field to our PDFFormField interface */ private convertField; /** * Map pdf-lib field type to our enum */ private getFieldType; /** * Infer human-readable label from field name */ private inferLabelFromName; /** * Detect language from text content */ private detectLanguage; /** * Check if text contains optional indicator */ private isOptionalIndicator; /** * Extract document requirements from PDF text */ private extractDocumentRequirements; /** * Remove duplicate document requirements */ private deduplicateRequirements; /** * Group fields into sections based on page layout or naming patterns */ private groupFieldsIntoSections; /** * Extract form identification info (form numbers, authority, etc.) */ private extractFormInfo; /** * Calculate confidence score based on extraction results */ private calculateConfidence; /** * Clear the extraction cache */ clearCache(): void; } /** * Create a new PDF form extractor instance */ export declare function createPDFFormExtractor(): PDFFormExtractor; /** * Extract form fields from a PDF source (URL, file path, or buffer) */ export declare function extractPDFFormFields(source: string | Buffer, options?: PDFFormExtractionOptions): Promise; //# sourceMappingURL=pdf-form-extractor.d.ts.map