/** * PDFKitRenderer * * Lightweight PDF renderer using PDFKit. * Direct PDF generation without HTML/CSS - programmatic API. * * **Supported Formats**: PDF only * * **Pros**: * - Very lightweight (~few MB vs ~200MB for Puppeteer) * - Fast * - No browser dependency * - Pure Node.js * - Good for programmatic PDFs * * **Cons**: * - No HTML/CSS support * - Manual layout required * - Limited text rendering * - Not suitable for complex documents * * **Best For**: * - Simple receipts * - Certificates * - Basic invoices * - Programmatically generated PDFs * - Server environments without browser */ import { type StorageRenderOptions, type StorageRenderResult, type StorageRendererHealthCheck } from '@plyaz/types/storage'; import { BaseRendererAdapter } from '../base/BaseRendererAdapter'; import type { StoragePDFKitRendererConfig } from '@plyaz/types/storage'; /** * PDFKitRenderer Adapter * * Lightweight PDF generation without browser dependency. * * @example * ```typescript * const renderer = new PDFKitRenderer({ * name: 'pdfkit-main', * type: STORAGE_RENDERER_TYPE.PDFKIT, * enabled: true, * priority: 50, * supportedFormats: [OUTPUT_FORMAT.PDF], * }); * * const result = await renderer.render({ * format: OUTPUT_FORMAT.PDF, * data: { * title: 'Invoice', * content: [ * { type: 'heading', data: 'Invoice #12345', options: { fontSize: 24 } }, * { type: 'text', data: 'Amount: $100.00', options: {} } * ] * } * }); * ``` */ export declare class PDFKitRenderer extends BaseRendererAdapter { private readonly defaultOptions; constructor(config: StoragePDFKitRendererConfig); /** * Render content */ render(options: StorageRenderOptions): Promise; /** * Generate PDF using PDFKit * @private */ private generatePDF; /** * Render a section of the document * @private */ private renderSection; /** * Get document data from options * @private */ private getDocumentData; /** * Get PDF options * @private */ private getPDFOptions; /** * Parse margin string to number (e.g., "20mm" → 56.69) * @private */ private parseMargin; /** * Check renderer health */ checkHealth(): Promise; }