Rental Yield Calculator
Property & Financial Details
$
$
Annual Expenses
$
$
$
$
Other Factors
%
%
Results Summary
0.00%
Gross Rental Yield
0.00%
Net Rental Yield
Gross Annual Income:
$0
Total Annual Expenses:
-$0
Net Annual Income:
$0
Rental Yield Calculation Report
Calculation Inputs
Results Summary
Management Fees: ${formatPercent(currentResults.managementFees)}
`; pdfResultsEl.innerHTML = `Gross Annual Income: ${formatCurrency(currentResults.grossAnnualIncome)}
Total Annual Expenses: ${formatCurrency(currentResults.totalAnnualExpenses)}
Net Annual Income: ${formatCurrency(currentResults.netAnnualIncome)}
Gross Rental Yield: ${formatPercent(currentResults.grossYield)}
Net Rental Yield: ${formatPercent(currentResults.netYield)}
`; // Make the PDF content temporarily visible for rendering pdfContentEl.style.display = 'block'; const { jsPDF } = window.jspdf; // Use html2canvas to render the div to a canvas html2canvas(pdfContentEl, { scale: 2 }).then(canvas => { const imgData = canvas.toDataURL('image/png'); // Define PDF dimensions const pdf = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const canvasWidth = canvas.width; const canvasHeight = canvas.height; const ratio = canvasWidth / canvasHeight; const imgWidth = pdfWidth - 20; // with margin const imgHeight = imgWidth / ratio; let position = 10; pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight); pdf.save('Rental-Yield-Report.pdf'); // Hide the PDF content again after rendering pdfContentEl.style.display = 'none'; }); }); } });