mylloon.fr/static/js/libs/jspdf.js

15 lines
322 B
JavaScript
Raw Normal View History

2023-04-24 16:19:35 +02:00
window.addEventListener("load", () => {
2023-04-24 16:18:54 +02:00
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`);
},
});
});