File tree 3 files changed +28
-1
lines changed
3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -1112,6 +1112,7 @@ def update_page_form_field_values(
1112
1112
v = NameObject ("/Off" )
1113
1113
# other cases will be updated through the for loop
1114
1114
annotation [NameObject (AA .AS )] = v
1115
+ annotation [NameObject (FA .V )] = v
1115
1116
elif (
1116
1117
parent_annotation .get (FA .FT ) == "/Tx"
1117
1118
or parent_annotation .get (FA .FT ) == "/Ch"
Original file line number Diff line number Diff line change
1
+ """Test form-related functionality. Separate file to keep overview."""
2
+
3
+ from io import BytesIO
4
+
5
+ import pytest
6
+
7
+ from pypdf import PdfReader , PdfWriter
8
+ from tests import get_data_from_url
9
+
10
+
11
+ @pytest .mark .enable_socket
12
+ def test_form_button__v_value_should_be_name_object ():
13
+ url = "https://github.com/user-attachments/files/18736500/blank-form.pdf"
14
+ name = "issue3115.pdf"
15
+ reader = PdfReader (BytesIO (get_data_from_url (url , name = name )))
16
+ writer = PdfWriter (clone_from = reader )
17
+ writer .update_page_form_field_values (
18
+ writer .pages [0 ],
19
+ {"Other" : "/On" },
20
+ auto_regenerate = False ,
21
+ )
22
+ stream = BytesIO ()
23
+ writer .write (stream )
24
+
25
+ # Wrong: `/V (/On)`.
26
+ assert b"\n /V /On\n " in stream .getvalue ()
Original file line number Diff line number Diff line change @@ -1035,7 +1035,7 @@ def test_inline_images():
1035
1035
1036
1036
1037
1037
@pytest .mark .enable_socket
1038
- def test_iss ():
1038
+ def test_issue1899 ():
1039
1039
url = "https://github.com/py-pdf/pypdf/files/11801077/lv2018tconv.pdf"
1040
1040
name = "lv2018tconv.pdf"
1041
1041
reader = PdfReader (BytesIO (get_data_from_url (url , name = name )))
You can’t perform that action at this time.
0 commit comments