# PDF Autofill Demo
## Summary
A Streamlit app to upload a PDF form, select a SQLite table, map fields, and auto-fill/download PDFs.
## Features
- SQLite setup with sample `customers` table
- PDF form field extraction
- Interactive field-to-column mapping
- Batch fill & download per row
## Requirements
- Python 3.7+
- streamlit
- pandas
- pdfjinja
- pypdf
- pdfrw
## Installation
```bash
pip install streamlit pandas pdfjinja pypdf pdfrw-
Set
secrets.sqlite.pathin Streamlit or use defaultdemo.db. -
Run:
streamlit run streamlit_course_app.py
-
Choose table, upload PDF form, map fields, click Generate PDFs.
- init_db(): creates & seeds
customers - extract_fields(): reads form fields via
pdfrw - fill_pdf_bytes(): clones & fills PDF with
pypdf - Streamlit UI: table selector, field mapper, uploader, download buttons
- Change
DB_PATHor table seed data - Adjust field-chunking logic in
extract_fields() - Modify UI labels/buttons in Streamlit