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

15 lines
334 B
JavaScript
Raw Normal View History

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