import type { IPdf } from '../../interfaces/common.js'; /** * Error types for PDF embedding operations */ export declare enum PDFEmbedError { LOAD_ERROR = "PDF loading failed", EMBED_ERROR = "XML embedding failed", SAVE_ERROR = "PDF saving failed", INVALID_INPUT = "Invalid input parameters" } /** * Result of a PDF embedding operation */ export interface PDFEmbedResult { success: boolean; data?: Uint8Array; pdf?: IPdf; error?: { type: PDFEmbedError; message: string; originalError?: Error; }; } /** * Class for embedding XML into PDF files * Provides robust error handling and support for different PDF formats */ export declare class PDFEmbedder { /** * Embeds XML into a PDF * @param pdfBuffer PDF buffer * @param xmlContent XML content to embed * @param filename Filename for the embedded XML * @param description Description for the embedded XML * @returns Result with either modified PDF buffer or error information */ embedXml(pdfBuffer: Uint8Array | Buffer, xmlContent: string, filename?: string, description?: string): Promise; /** * Creates an IPdf object with embedded XML * @param pdfBuffer PDF buffer * @param xmlContent XML content to embed * @param filename Filename for the embedded XML * @param description Description for the embedded XML * @param pdfName Name for the PDF * @param pdfId ID for the PDF * @returns Result with either IPdf object or error information */ createPdfWithXml(pdfBuffer: Uint8Array | Buffer, xmlContent: string, filename?: string, description?: string, pdfName?: string, pdfId?: string): Promise; /** * Ensures the filename is normalized according to PDF/A requirements * @param filename Filename to normalize * @returns Normalized filename */ private normalizeFilename; /** * Tries to detect the format of the XML content * @param xmlContent XML content * @returns Format string or undefined */ private detectPdfFormat; /** * Creates an error result object * @param type Error type * @param message Error message * @param originalError Original error object * @returns Error result */ private createErrorResult; }