/** * PDF Extractor - Extract text and structured data from PDF files * * Useful for: * - Processing government PDF documents * - Extracting text from official forms and regulations * - Handling downloadable visa requirement documents */ export interface PDFExtractResult { text: string; numPages: number; info: { title?: string; author?: string; subject?: string; keywords?: string; creationDate?: Date; modificationDate?: Date; }; metadata?: Record; } export interface PDFPageContent { pageNumber: number; text: string; } /** * Extract text content from a PDF buffer */ export declare function extractPDFText(pdfBuffer: Buffer): Promise; /** * Extract text from a PDF URL */ export declare function extractPDFFromURL(url: string): Promise; /** * Extract text from a PDF file path */ export declare function extractPDFFromFile(filePath: string): Promise; /** * Extract structured sections from PDF text * Attempts to identify headers, paragraphs, and lists */ export declare function structurePDFContent(text: string): { sections: { heading: string; content: string; }[]; lists: string[][]; }; /** * Extract key-value pairs from PDF (common in forms) */ export declare function extractKeyValuePairs(text: string): Map; /** * Check if a URL points to a PDF */ export declare function isPDFUrl(url: string): boolean; export type { PDFFormField, PDFFormSection, PDFDocumentRequirement, PDFFormExtractionResult, PDFFormExtractionOptions, PDFFormFieldType, PDFFormInfo, } from '../types/pdf-forms.js'; /** * PDF extractor class for stateful operations */ export declare class PDFExtractor { private cache; /** * Extract with caching */ extract(source: string | Buffer): Promise; /** * Clear cache */ clearCache(): void; /** * Get structured content */ extractStructured(source: string | Buffer): Promise<{ result: PDFExtractResult; sections: { heading: string; content: string; }[]; lists: string[][]; keyValues: Map; }>; /** * Extract form fields from PDF (INT-017) * * Extracts fillable form fields (AcroForms) from PDFs using pdf-lib. * Also extracts document requirements from text content. * * @example * ```typescript * const extractor = new PDFExtractor(); * const result = await extractor.extractFormFields('https://example.gov/form.pdf', { * language: 'es', * extractDocumentRequirements: true, * }); * console.log(`Found ${result.fields.length} form fields`); * ``` */ extractFormFields(source: string | Buffer, options?: import('../types/pdf-forms.js').PDFFormExtractionOptions): Promise; /** * Get buffer from source (URL or file path) */ private getBuffer; } export declare const pdfExtractor: PDFExtractor; //# sourceMappingURL=pdf-extractor.d.ts.map