Automated Competitive Valuation Benchmarking System

Automated Competitive Valuation Benchmarking System

Compare your target company against peers using common valuation multiples.

1. Target Company Details

2. Comparable Companies

Add details for companies similar to your target company.

Estimated P/E Valuation: $${calculatedData.benchmarkedValuations.pe.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}M

`; pdfHtmlContent += `

Estimated P/S Valuation: $${calculatedData.benchmarkedValuations.ps.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}M

`; // Valuation Insights pdfHtmlContent += `

Valuation Insights:

`; pdfHtmlContent += `

${calculatedData.insights}

`; pdfRenderContainer.innerHTML = pdfHtmlContent; try { const canvas = await html2canvas(pdfRenderContainer, { useCORS: true, scale: 2, logging: false }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF('p', 'mm', 'a4'); const imgWidth = 210; const pageHeight = 297; const imgHeight = canvas.height * imgWidth / canvas.width; let heightLeft = imgHeight; let position = 0; pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); heightLeft -= pageHeight; while (heightLeft >= 0) { position = heightLeft - imgHeight; pdf.addPage(); pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); heightLeft -= pageHeight; } pdf.save('valuation_benchmarking_report.pdf'); } catch (error) { console.error('Error generating PDF:', error); alertUser('Failed to generate PDF. Please try again or check console for errors.'); } finally { pdfRenderContainer.innerHTML = ''; } }); // --- Custom Alert Function --- function alertUser(message) { let msgBox = document.getElementById('user-message-box'); let messageTextSpan; let closeButton; if (!msgBox) { msgBox = document.createElement('div'); msgBox.id = 'user-message-box'; msgBox.className = 'fixed inset-x-0 top-0 flex items-center justify-center p-4 z-50'; msgBox.innerHTML = ` `; document.body.appendChild(msgBox); // Now query within msgBox, after it's in the DOM messageTextSpan = msgBox.querySelector('#user-message-text'); closeButton = msgBox.querySelector('#close-user-message'); closeButton.addEventListener('click', () => { msgBox.classList.add('hidden'); }); } else { // If msgBox already exists, just get references to its children messageTextSpan = msgBox.querySelector('#user-message-text'); closeButton = msgBox.querySelector('#close-user-message'); } messageTextSpan.innerHTML = message; // Use innerHTML to allow line breaks msgBox.classList.remove('hidden'); setTimeout(() => { msgBox.classList.add('hidden'); }, 5000); } });
Scroll to Top