`;
});
}
if (education.length > 0) {
html += `
`;
});
}
if (skills.length > 0) {
html += `
`;
});
}
content.innerHTML = html;
}
// --- PDF DOWNLOAD LOGIC ---
downloadPdfBtn.addEventListener('click', () => {
const { jsPDF } = window.jspdf;
const contentToPrint = document.getElementById('resume-preview-container');
html2canvas(contentToPrint, {
scale: 2, // Improve resolution
logging: false,
useCORS: true
}).then(canvas => {
const imgData = canvas.toDataURL('image/png');
const pdf = new jsPDF({
orientation: 'portrait',
unit: 'in',
format: [8.5, 11]
});
pdf.addImage(imgData, 'PNG', 0, 0, 8.5, 11);
pdf.save(`${resumeData.personal.fullName || 'resume'}.pdf`);
});
});
// --- INITIAL RENDER ---
updateAndRender();
lucide.createIcons();
});
Education
`; education.forEach(edu => { html += `${edu.degree}
${edu.institution} | ${edu.dates}
Skills
`; html += `${skills.join(', ')}
`; } if (portfolio.length > 0) { html += `Portfolio
`; portfolio.forEach(item => { html += `${item.title} ${item.url ? `(Link)` : ''}
${item.description}
