Cover Letter Optimization Tool

Cover Letter Optimization Tool

Tailor your cover letter to land the interview.

Optimization Report

Your report will appear here.

Cover Letter Optimization Report

Optimized Cover Letter

Key Suggestions

    Original Job Description

    Original Cover Letter

    ${item.suggestion}

    ${item.reason}

    `).join(''); resultsOutput.classList.remove('hidden'); downloadPdfBtn.disabled = false; } async function handlePdfDownload() { if (!analysisDataForPdf) { alert("Please generate an analysis first."); return; } // Populate the hidden div document.getElementById('pdf-optimized').textContent = analysisDataForPdf.optimizedLetter; document.getElementById('pdf-job-desc').textContent = jobDescInput.value; document.getElementById('pdf-cover-letter').textContent = coverLetterInput.value; document.getElementById('pdf-suggestions').innerHTML = analysisDataForPdf.suggestions.map(item => `
  • ${item.suggestion}: ${item.reason}
  • ` ).join(''); const contentToPrint = document.getElementById('pdf-output'); contentToPrint.style.display = 'block'; try { const canvas = await html2canvas(contentToPrint, { scale: 2 }); const { jsPDF } = window.jspdf; const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save('Cover-Letter-Optimization-Report.pdf'); } catch (err) { console.error("Error generating PDF:", err); alert("Could not generate PDF."); } finally { contentToPrint.style.display = 'none'; } } // --- EVENT LISTENERS --- optimizeBtn.addEventListener('click', handleOptimization); downloadPdfBtn.addEventListener('click', handlePdfDownload); // --- INITIALIZATION --- lucide.createIcons(); });
    Scroll to Top