name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: Multi-page PDF autofill resets index and misaligns field values"
labels: bug
assignees: ''
⚡️ Describe the Bug
In src/backend.py inside Fill.fill_form, the answer index i is reset for every PDF page.
For multi-page forms, page 2 starts filling again from the first extracted answer, causing incorrect field-value mapping.
👣 Steps to Reproduce
- Use a fillable PDF with text fields on at least 2 pages.
- Provide enough extracted values to fill all fields.
- Run
Fill.fill_form(...).
- Open output PDF and compare values on page 2+ with expected order.
📉 Expected Behavior
Field filling should continue sequentially across all pages, not restart from the first value on each page.
🖥️ Environment Information
- OS: macOS / Linux (reproducible across environments)
- Docker/Compose Version: Docker Compose v2.x
- Ollama Model used: Mistral (via Ollama)
📸 Screenshots/Logs
Relevant code path:
src/backend.py in Fill.fill_form (around lines 151–159).
i = 0 is currently inside for page in pdf.pages:, so the index resets on every page.
🕵️ Possible Fix
Move i = 0 before iterating pages so index is global across the whole document.
Add a regression test with a 2-page fillable PDF fixture to verify correct mapping.
name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: Multi-page PDF autofill resets index and misaligns field values"
labels: bug
assignees: ''
⚡️ Describe the Bug
In
src/backend.pyinsideFill.fill_form, the answer indexiis reset for every PDF page.For multi-page forms, page 2 starts filling again from the first extracted answer, causing incorrect field-value mapping.
👣 Steps to Reproduce
Fill.fill_form(...).📉 Expected Behavior
Field filling should continue sequentially across all pages, not restart from the first value on each page.
🖥️ Environment Information
📸 Screenshots/Logs
Relevant code path:
src/backend.pyinFill.fill_form(around lines 151–159).i = 0is currently insidefor page in pdf.pages:, so the index resets on every page.🕵️ Possible Fix
Move
i = 0before iterating pages so index is global across the whole document.Add a regression test with a 2-page fillable PDF fixture to verify correct mapping.