lock plus

Packaging

'); doc.close(); // Temporary variable to store the onload handler to prevent loop var printHandler = function() { console.log("PDF iframe loaded, triggering print"); iframe.contentWindow.focus(); iframe.contentWindow.print(); // Clear the iframe content after printing to avoid unintended reuse iframe.src = 'about:blank'; // Remove the onload handler to prevent further triggers iframe.onload = null; }; iframe.onload = printHandler; // Set the handler for the iframe onload } else { console.log("PDF iframe not found"); } }); } else { console.log("PDF button not found"); } });