legal-markdown-js
Version:
Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version
87 lines • 3.26 kB
TypeScript
/**
* 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
*
* Creates a right-aligned footer with "Page X / Y" format using Puppeteer's
* special classes for dynamic page numbering.
*
* @returns {string} HTML template string for the footer
* @example
* ```typescript
* const footer = PdfTemplates.generateFooterTemplate();
* // Results in: "Pg: 1 / 10" format in the PDF
* ```
*/
static generateFooterTemplate(): 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