Closed Ezbaze closed 5 months ago
You have to call pdf.init_forms()
after document load, before page handle retrieval.
This was an exceptional API-breaking change in v4.1/4.2, due to issues in the previous API design, which did not correctly reflect pdfium's control flow. I resolved to do it because we were still early in the v4 series, where most embedders presumably hadn't migrated yet.
I see, thanks for the reply <3
I could not find this when searching online ._.
I could not find this when searching online ._.
The docs on init_forms()
and render() [may_draw_forms]
somewhat note it, but I agree it may be hard to find 😅
There were also entries in the changelog for v4.1/4.2 ("API-breaking changes around forms code, necessary to fix conceptual issues."), but maybe we should have formulated it more concretely.
The docs on
init_forms()
andrender() [may_draw_forms]
somewhat note it
Thank you <3
but maybe we should have formulated it more concretely.
I think it's just the way it was worded, my search queries were "pypdfium2 form fields not rendering" and the results weren't helpful, hopefuly this comes up for anyone that stumles into the same issue :)
Checklist
pypdfium2
fromPyPI
orGitHub/pypdfium2-team
.Description
For some reason the latest versions of pypdfium2 do not render form fields.
When rendering the image in 4.0.0:
When rendering in versions after 4.0.0: ( Insert white rectangle :) )
Code used:
File used (Clean file with 1 form field): test_document.pdf
Install Info
Validity