Public Records Request Generator

Public Records Request Generator

Requester Information

Recipient Agency Information

Request Details

Fee Waiver Justification (Optional)

About Your Request

This tool generates a template based on the U.S. Freedom of Information Act (FOIA) and similar state-level public records laws. While we use standard language, always confirm the specific requirements of the agency you are contacting.

Key Steps:

  1. Fill out the **Request Details** tab completely.
  2. Go to the **Generated Request** tab to review the letter.
  3. Click **Download Request as PDF** and send the resulting document to the agency's dedicated FOIA Officer via email or certified mail.

Tips for Success:

  • Be Specific: Use dates, subject names, or internal project names if known. Vague requests are often rejected.
  • Format: Requesting electronic format (PDF) is generally faster and cheaper.
  • Fee Waivers: Only ask for a fee waiver if your request genuinely serves the public interest (e.g., you are a journalist or researcher) and is not for commercial purposes.

${request.justification}

I agree to pay reasonable search and duplication fees up to \$25.00, but please notify me if the cost will exceed this amount. Please treat this as a request for a fee waiver.

`; } else { letterContent += `

I agree to pay reasonable search and duplication fees up to \$25.00, but please notify me if the cost will exceed this amount.

`; } // 7. Closing letterContent += `

I look forward to receiving your response within the statutory time limit. Thank you for your time and cooperation.

Sincerely,

${requester.name}
`; generatedRequestDiv.innerHTML = letterContent; } // --- EVENT HANDLERS --- function attachEventListeners() { // Attach event listener to the main container for input changes document.getElementById('prrg-tab-config').addEventListener('input', updateGeneratedRequest); // Navigation prevBtn.addEventListener('click', () => prrg_changeTab(state.currentTab - 1)); nextBtn.addEventListener('click', () => prrg_changeTab(state.currentTab + 1)); // PDF document.getElementById('prrg-download-pdf-btn').addEventListener('click', generatePDF); } // --- TABS & NAVIGATION --- window.prrg_changeTab = function(tabIndex) { if (tabIndex < 0 || tabIndex >= tabButtons.length) return; state.currentTab = tabIndex; tabButtons.forEach((b, i) => b.classList.toggle('active', i === tabIndex)); tabContents.forEach((c, i) => c.classList.toggle('active', i === tabIndex)); // Update navigation buttons prevBtn.style.visibility = state.currentTab === 0 ? 'hidden' : 'visible'; nextBtn.style.visibility = state.currentTab === tabButtons.length - 1 ? 'hidden' : 'visible'; if (tabIndex === 0) { updateGeneratedRequest(); } } // --- PDF GENERATION --- function generatePDF() { const { jsPDF } = window.jspdf; const container = document.getElementById('prrg-container'); const outputWrapper = document.getElementById('prrg-request-output-wrapper'); // Prepare for PDF capture container.classList.add('prrg-pdf-export-mode'); html2canvas(outputWrapper, { scale: 2 }).then(canvas => { // Restore original view container.classList.remove('prrg-pdf-export-mode'); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF('p', 'mm', '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; // 10mm margin const imgHeight = imgWidth / ratio; let heightLeft = imgHeight; let position = 10; // Top margin pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight); heightLeft -= pdfHeight; while (heightLeft > -pdfHeight) { position = imgHeight - (pdfHeight * Math.floor(imgHeight / pdfHeight)); // Calculate position for next page if (position > 0) position -= (pdfHeight * Math.floor(imgHeight / pdfHeight)); pdf.addPage(); pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight); heightLeft -= pdfHeight; } const agencyName = state.recipient.agency.split(' ')[0] || 'records'; pdf.save(`${agencyName}_request.pdf`); }).catch(err => { container.classList.remove('prrg-pdf-export-mode'); console.error("PDF generation failed:", err); alert("Could not generate PDF. Please ensure your browser has permission."); }); } // --- START THE APP --- init(); }); })();
Scroll to Top