Rental Agreement Generator

Rental Agreement Generator

Property & Parties

Lease Term

Financial Terms

$
$
$

Utilities & Rules

Configure details in the previous tabs and click "Generate Agreement" to see the full contract here.

The term of this lease shall commence on ${data.start} and shall terminate on ${data.end}, for a duration of ${data.duration} months (${data.type}). If the tenancy is month-to-month, it continues until terminated by either party with proper notice.

3. RENT AND DEPOSITS

The Tenant agrees to pay monthly rent of ${data.rent} USD, due on the ${data.dueDay} day of each month. A security deposit of ${data.securityDeposit} USD is required and held for the duration of the tenancy. ${data.petDeposit !== '$0' ? `A non-refundable pet deposit of ${data.petDeposit} USD is also required.` : ''}

4. UTILITIES AND SERVICES

The Landlord shall provide and pay for the following utilities/services:

    ${data.utilities}
The Tenant is responsible for all other utilities and services not listed above.

5. TENANT OBLIGATIONS AND RULES

The Tenant agrees to abide by the following additional rules and restrictions:

    ${data.rules}
The Tenant agrees to maintain the premises in a clean and sanitary condition.

6. GOVERNING LAW

This Lease Agreement shall be governed by the laws of the State where the property is located.

Landlord Signature: ${data.landlordName}
Date: ${today}
Tenant Signature: ${data.tenantName}
Date: ${today}
`; agreementContentDiv.innerHTML = agreementHtml; }; // --- Button Event Listeners (Flow Control) --- next1Btn.addEventListener("click", () => { generateAgreement(); // Keep agreement updated showTab('rag-tab-2'); }); prev2Btn.addEventListener("click", () => { showTab('rag-tab-1'); }); generateBtn.addEventListener("click", () => { generateAgreement(); showTab('rag-tab-dashboard'); }); // --- PDF Download --- pdfBtn.addEventListener("click", () => { const { jsPDF } = window.jspdf; const tenant = tenantNameInput.value.replace(/[^a-zA-Z0-9]/g, '_') || 'Tenant'; const fileName = `${tenant}_Rental_Agreement.pdf`; html2canvas(exportArea, { scale: 2, useCORS: true, backgroundColor: '#ffffff' }).then(canvas => { const imgData = canvas.toDataURL('image/png'); const doc = new jsPDF({ orientation: 'p', unit: 'pt', format: 'letter' // Use US Letter format }); const pdfWidth = doc.internal.pageSize.getWidth(); const pdfHeight = doc.internal.pageSize.getHeight(); const imgProps = doc.getImageProperties(imgData); const imgWidth = imgProps.width; const imgHeight = imgProps.height; const margin = 40; const usableWidth = pdfWidth - (2 * margin); const ratio = usableWidth / imgWidth; let scaledHeight = imgHeight * ratio; // Handle multi-page if content exceeds page height if (scaledHeight > pdfHeight - (2 * margin)) { const pageHeight = pdfHeight - (2 * margin); let heightLeft = scaledHeight; let position = 0; while (heightLeft > 0) { doc.addImage(imgData, 'PNG', margin, position + margin, usableWidth, scaledHeight); heightLeft -= pageHeight; position -= pageHeight; if (heightLeft > 0) { doc.addPage(); } } } else { // Single page doc.addImage(imgData, 'PNG', margin, margin, usableWidth, scaledHeight); } doc.save(fileName); }).catch(err => { console.error("RAG PDF Error:", err); // alert("An error occurred while generating the PDF."); // Per spec }); }); // --- Initial Load --- generateAgreement(); // Render initial sample content showTab('rag-tab-1'); // Start on the first configuration tab });
Scroll to Top