UNPKG

@fin.cx/einvoice

Version:

A TypeScript module for creating, manipulating, and embedding XML data within PDF files specifically tailored for electronic invoice (einvoice) packages.

41 lines (40 loc) 1.17 kB
/** * Class for extracting XML from PDF files with robust error handling */ export declare class RobustPDFExtractor { /** * Extracts XML from a PDF buffer * @param pdfBuffer PDF buffer * @returns XML content or null if not found */ extractXml(pdfBuffer: Uint8Array | Buffer): Promise<string | null>; /** * Standard extraction method using PDF-lib * @param pdfBuffer PDF buffer * @returns XML content or null if not found */ private standardExtraction; /** * Alternative extraction method using a more robust approach * @param pdfBuffer PDF buffer * @returns XML content or null if not found */ private alternativeExtraction; /** * Extracts XML from a string * @param pdfString PDF string * @returns XML content or null if not found */ private extractXmlFromString; /** * Checks if an XML string is valid * @param xmlString XML string to check * @returns True if the XML is valid */ private isValidXml; /** * Extracts a sample XML file for testing * @returns Sample XML content */ private extractSampleXml; }