Utility Cost Breakdown: City vs. Rural Living

Enter Monthly Utility Costs (USD $)

Provide your best estimates for monthly costs. If a utility is not applicable or included elsewhere (e.g., water in rent), you can enter 0 or leave a note.

Side-by-Side Cost Comparison

Please enter utility costs in the 'Utility Inputs' tab and click 'Calculate & Compare Costs'.

General Notes & Influencing Factors

Use this space to add any overarching comments, assumptions, or non-cost factors relevant to your comparison (e.g., lifestyle preferences, commute, availability of services).

${ruralGeneralNotes}

`; html += `
`; } pdfContentElement.innerHTML = html; document.body.appendChild(pdfContentElement); // Must be in DOM for html2canvas html2canvas(pdfContentElement, { scale: 1.5, useCORS: true, windowWidth: pdfContentElement.scrollWidth, windowHeight: pdfContentElement.scrollHeight }).then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdfWidth = pdf.internal.pageSize.getWidth(); const pageHeight = pdf.internal.pageSize.getHeight(); const imgActualWidth = canvas.width; const imgActualHeight = canvas.height; const aspectRatio = imgActualWidth / imgActualHeight; const pageMargin = 10; // mm let imgWidthInPdf = pdfWidth - (2 * pageMargin); let imgHeightInPdf = imgWidthInPdf / aspectRatio; let heightLeft = imgHeightInPdf; let position = pageMargin; pdf.addImage(imgData, 'PNG', pageMargin, position, imgWidthInPdf, imgHeightInPdf); heightLeft -= (pageHeight - (2 * pageMargin)); while (heightLeft > 0) { position = heightLeft - imgHeightInPdf - pageMargin; // Recalculate position for next page pdf.addPage(); pdf.addImage(imgData, 'PNG', pageMargin, position, imgWidthInPdf, imgHeightInPdf); heightLeft -= (pageHeight - (2*pageMargin)); } pdf.save('Utility_Cost_City_vs_Rural.pdf'); document.body.removeChild(pdfContentElement); }).catch(error => { console.error("Error generating PDF:", error); alert("Could not generate PDF. See console for details."); if (document.body.contains(pdfContentElement)) { document.body.removeChild(pdfContentElement); } }); }
Scroll to Top