`;
// 2. Generate PDF using a temporary container
const tempDiv = document.createElement('div');
tempDiv.innerHTML = finalContentHtml;
document.body.appendChild(tempDiv);
const opt = {
margin: 0.5,
filename: filename,
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
};
html2pdf().set(opt).from(tempDiv).save().then(() => {
document.body.removeChild(tempDiv);
});
}
return {
switchTab,
updateMeta,
updateDoc,
generatePDF
};
})();
