Commit f79f8e5
Bob Strahan
fix(ocr): add page.flatten() for fillable PDFs without appearance streams (#240)
init_forms() alone is insufficient for fillable PDFs that lack pre-generated
appearance streams for form fields (common in government forms like VA-21-22a).
page.flatten() forces PDFium to generate appearances and merge them into page
content before rendering, ensuring all form field values are visible.
Changes:
- ocr/service.py: add page.flatten() before _extract_page_image() in rendering loop
- bda_processresults_function/index.py: add page.flatten() before render()
- test_ocr_service.py: verify both init_forms() and flatten() are called
- CHANGELOG.md: update fix description with two-part explanation1 parent 1c3b99d commit f79f8e5
4 files changed
Lines changed: 17 additions & 1 deletion
File tree
- lib/idp_common_pkg
- idp_common/ocr
- tests/unit/ocr
- patterns/unified/src/bda_processresults_function
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
429 | 435 | | |
430 | 436 | | |
431 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
356 | 361 | | |
357 | 362 | | |
358 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
168 | 173 | | |
169 | 174 | | |
170 | 175 | | |
| |||
0 commit comments