Skip to content

Commit

Permalink
use resolve() instead of .resolve()
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremybmerrill authored Aug 12, 2023
1 parent 89814b3 commit 441acdc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ Sometimes PDF files can contain forms that include inputs that people can fill o
For example, this snippet will retrieve form field names and values and store them in a dictionary.

```python
from pdfplumber.utils.pdfinternals import resolve_and_decode
import pdfplumber
from pdfplumber.utils.pdfinternals import resolve_and_decode, resolve

pdf = pdfplumber.open("document_with_form.pdf")

Expand All @@ -453,7 +454,7 @@ def parse_field_helper(form_data, field, prefix=None):


form_data = []
fields = pdf.doc.catalog["AcroForm"].resolve()["Fields"]
fields = resolve(pdf.doc.catalog["AcroForm"])["Fields"]
for field in fields:
parse_field_helper(form_data, field)
```
Expand Down

0 comments on commit 441acdc

Please sign in to comment.