/** * ┌─────────────────────────────────────────────────────────────────────────┐ * │ WATERMARK UTILITIES - PDF Watermark Functions │ * ├─────────────────────────────────────────────────────────────────────────┤ * │ Filename: watermark-utils.ts │ * │ Language: TypeScript │ * │ MCP Server: PDF Operations Server │ * │ │ * │ Purpose: │ * │ Provides utility functions for adding custom watermarks to PDF files. │ * │ Supports text watermarks with full customization: position, color, │ * │ opacity, rotation, and more. Optimized for large PDFs (300+ pages). │ * │ │ * │ Why this file exists: │ * │ - Centralizes watermark logic for reuse across tools │ * │ - Implements memory-efficient processing for large PDFs │ * │ - Provides position calculation and text rendering │ * │ - Handles edge cases and error scenarios gracefully │ * │ │ * │ Features: │ * │ - Position presets: corners, center, custom coordinates │ * │ - Text customization: font, size, color, opacity, rotation │ * │ - Memory optimization: batch processing for large files │ * │ - Smart defaults for missing configuration │ * │ │ * │ Security Considerations: │ * │ - Validates input and output paths │ * │ - Prevents path traversal attacks │ * │ - Handles memory limits gracefully │ * │ - Validates color and opacity ranges │ * │ │ * │ Dependencies: │ * │ - pdf-lib: PDF creation and modification │ * │ - @pdf-lib/fontkit: Custom font support │ * │ - fs/promises: Async file operations │ * │ - path: Path manipulation │ * │ │ * │ Author: PDF MCP Team │ * │ Created: 2025-10-29 │ * │ Version: 1.0.0 │ * └─────────────────────────────────────────────────────────────────────────┘ */ import type { WatermarkConfig } from '../types.js'; /** * Adds watermark to all pages of a PDF document * Processes in batches for memory efficiency with large PDFs * * @param inputPath - Path to the input PDF file * @param config - Watermark configuration * @param outputPath - Optional output path (defaults to input_watermarked.pdf) * @returns Object containing output path and number of pages processed */ export declare function addWatermarkToPDF(inputPath: string, config: WatermarkConfig, outputPath?: string): Promise<{ outputPath: string; pagesProcessed: number; }>; /** * Batch processing fallback for extremely large PDFs (1000+ pages) * Splits PDF into chunks, processes each chunk, then merges * * @param inputPath - Path to the input PDF file * @param config - Watermark configuration * @param outputPath - Optional output path * @returns Object containing output path and number of pages processed */ export declare function addWatermarkToPDFBatched(inputPath: string, config: WatermarkConfig, outputPath?: string): Promise<{ outputPath: string; pagesProcessed: number; }>; //# sourceMappingURL=watermark-utils.d.ts.map