From a40946c28841746ae848fb31158b5763afd2b943 Mon Sep 17 00:00:00 2001 From: Martin Thoma Date: Sun, 26 Jun 2022 11:18:18 +0200 Subject: [PATCH] DOC: get_form_text_fields does not extract dropdown data (#1029) See #391 --- PyPDF2/_reader.py | 10 +++++++++- sample-files | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/PyPDF2/_reader.py b/PyPDF2/_reader.py index 78ba3886d..c9cc1101f 100644 --- a/PyPDF2/_reader.py +++ b/PyPDF2/_reader.py @@ -560,7 +560,15 @@ def _write_field(self, fileobj: Any, field: Any, field_attributes: Any) -> None: pass def get_form_text_fields(self) -> Dict[str, Any]: - """Retrieves form fields from the document with textual data (inputs, dropdowns)""" + """ + Retrieves form fields from the document with textual data. + + The key is the name of the form field, the value is the content of the + field. + + If the document contains multiple form fields with the same name, the + second and following will get the suffix _2, _3, ... + """ # Retrieve document form fields formfields = self.get_fields() if formfields is None: diff --git a/sample-files b/sample-files index d7ce88b71..4d24ff93d 160000 --- a/sample-files +++ b/sample-files @@ -1 +1 @@ -Subproject commit d7ce88b71820fccaaa4738aa37cbace51f3ed3d9 +Subproject commit 4d24ff93dcddf21d55d028d9675d5b5bf9d7a350