import jsPDF from 'jspdf';
button("Download as PDF", async () => {
const rootElement = document.querySelector('body');
const imageDataUrl = await domtoimage.toPng(rootElement);
const pdf = new jsPDF();
pdf.addImage(imageDataUrl, 'PNG', 0, 0);
pdf.save('webpage_snapshot.pdf');
});