/** * Easy Invoice Document PDF Generation using html2canvas * Generates PDF from the actual rendered invoice/quote HTML * * @package Easy_Invoice * @version 1.0.0 */ (function() { 'use strict'; /** ISO 216 A4 (portrait) — explicit mm so PDF page size is always A4 in viewers. */ const A4_MM = { width: 210, height: 297 }; // Global Document PDF Generator Class window.DocumentPdfGenerator = class DocumentPdfGenerator { constructor(documentType = 'invoice') { this.documentType = documentType; // 'invoice' or 'quote' this.init(); } init() { // html2canvas and jsPDF are bundled with the plugin and loaded ahead of // this file by whoever renders the page (PdfHelper::enqueuePdfScripts(), // AdminAssets, or an explicit