window.addEventListener("load", () => { const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.html(document.body, { width: doc.internal.pageSize.getWidth() - 20, windowWidth: 800, margin: [15, 10, 10, 10], callback: function (doc) { doc.save(`${document.title}.pdf`); }, }); });