Python tool to auto-populate lesson plan PDFs with grade, subject, and topic text.
Takes a lesson plan PDF template and overlays grade level, subject area, and topic text at specified coordinates. Handles dynamic font sizing — longer topic names automatically scale down to fit within the bounding box.
- Opens a PDF template and inserts grade, subject, and topic text at defined coordinates
- Font size adapts based on text length:
- 15 characters or fewer: 18pt
- 16–20 characters: 16pt
- 21–25 characters: 12pt
- 26–40 characters: 8pt
- 41+ characters: 6pt
- Outputs a new PDF with all fields populated
- PyMuPDF (
fitz) — PDF manipulation
python "Testing Subject Name.py"Edit the script to set your input PDF path, output path, and text values for grade, subject, and topic.