UNPKG

legal-markdown-js

Version:

Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version

93 lines 3.61 kB
/** * PDF Template Generation for Headers and Footers * * This module provides reusable templates for PDF headers and footers with logo support. * It handles logo integration, positioning, and consistent styling across all PDF documents. * * @module */ /** * PDF Templates utility class for generating header and footer HTML templates * * Provides static methods to generate consistent header and footer templates * with optional logo integration and proper positioning for PDF generation. * * @class PdfTemplates * @example * ```typescript * const headerWithLogo = PdfTemplates.generateHeaderTemplate(logoBase64); * const footer = PdfTemplates.generateFooterTemplate(); * ``` */ export declare class PdfTemplates { /** * Generates HTML template for PDF headers with optional logo * * Creates a right-aligned header with logo support. The template uses flexbox * for proper positioning and maintains consistent spacing with document margins. * * @param {string} [logoBase64] - Optional base64 encoded logo image * @returns {string} HTML template string for the header * @example * ```typescript * // Header with logo * const headerWithLogo = PdfTemplates.generateHeaderTemplate('iVBORw0KGgoAAAANS...'); * * // Header without logo (empty) * const emptyHeader = PdfTemplates.generateHeaderTemplate(); * ``` */ static generateHeaderTemplate(logoBase64?: string): string; /** * Generates HTML template for PDF footers with page numbers and optional version * * Creates a footer with page numbers on the right. If a version is provided, * it displays on the left in a smaller font. * * @param {string} [version] - Optional version string from frontmatter metadata * @returns {string} HTML template string for the footer * @example * ```typescript * // Footer with version * const footer = PdfTemplates.generateFooterTemplate('1.2.0'); * // Results in: "v1.2.0" (left) and "Pg: 1 / 10" (right) * * // Footer without version (backward compatible) * const simpleFooter = PdfTemplates.generateFooterTemplate(); * // Results in: "Pg: 1 / 10" (right-aligned) * ``` */ static generateFooterTemplate(version?: string): string; /** * Generates a custom header template with text and optional logo * * Creates a header with both text content and logo, useful for documents * that need title information in addition to branding. * * @param {string} headerText - Text to display in the header * @param {string} [logoBase64] - Optional base64 encoded logo image * @returns {string} HTML template string for the custom header * @example * ```typescript * const customHeader = PdfTemplates.generateCustomHeaderTemplate( * 'Confidential Agreement', * logoBase64 * ); * ``` */ static generateCustomHeaderTemplate(headerText: string, logoBase64?: string): string; /** * Generates a custom footer template with text and page numbers * * Creates a footer with custom text on the left and page numbers on the right. * * @param {string} footerText - Text to display in the footer * @returns {string} HTML template string for the custom footer * @example * ```typescript * const customFooter = PdfTemplates.generateCustomFooterTemplate('© 2024 Company Name'); * ``` */ static generateCustomFooterTemplate(footerText: string): string; } //# sourceMappingURL=pdf-templates.d.ts.map