[CERTIFICATE_STUDENT_NAME]

 
 
 
                                                                          
[course_completion_date]       
 
 
 
[certificate_code]                                                          
 
 
 
 
 
top
ADR Academy (ADRA) ©  All rights reserved.
document.addEventListener("DOMContentLoaded", function () { // Only run on WPLMS certificate pages if (!window.location.pathname.includes("/certificates/")) { return; } // Find the print and download icons (current markup) const printIcon = document.querySelector(".vicon-printer"); const downloadIcon = document.querySelector(".vicon-vicon-download, .vicon-download, .vicon-file"); function doPrint(e) { if (e) e.preventDefault(); // The certificate wrapper on the page const cert = document.querySelector(".certificate"); if (!cert) { console.warn("Certificate wrapper '.certificate' not found, falling back to window.print()"); window.print(); return; } // Open a clean window for print/PDF const win = window.open("", "_blank"); if (!win) { console.error("Popup blocked; falling back to window.print()"); window.print(); return; } let html = ""; html += "Certificate"; html += ""; html += cert.outerHTML; html += ""; // Write certificate HTML into the new window win.document.open(); win.document.write(html); win.document.close(); // Give browser a moment to render, then print setTimeout(function () { try { win.focus(); win.print(); } catch (err) { console.error("Print failed, falling back to window.print()", err); window.print(); } // Optional: close after printing // win.close(); }, 600); } // Attach handlers if icons exist if (printIcon) { printIcon.addEventListener("click", doPrint); } if (downloadIcon) { downloadIcon.addEventListener("click", doPrint); } });