Skip to content

Commit

Permalink
Fixed checkbox not checked in FormWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
73VW committed Apr 8, 2024
1 parent c505c44 commit 6cf724d
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions PyPDFForm/patterns.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
# -*- coding: utf-8 -*-
"""Contains patterns used for identifying properties of widgets."""

from pypdf.generic import (DictionaryObject, NameObject, NumberObject,
TextStringObject)

from .constants import (AP, AS, CA, DA, FT, MK, READ_ONLY, Btn, Ch, D, Ff, Off,
Opt, Parent, Q, Sig, Subtype, T, Tx, V, Widget)
from pypdf.generic import DictionaryObject, NameObject, NumberObject, TextStringObject

from .constants import (
AP,
AS,
CA,
DA,
FT,
MK,
READ_ONLY,
Btn,
Ch,
D,
Ff,
Off,
Opt,
Parent,
Q,
Sig,
Subtype,
T,
Tx,
V,
Widget,
)
from .middleware.checkbox import Checkbox
from .middleware.dropdown import Dropdown
from .middleware.radio import Radio
Expand Down Expand Up @@ -86,6 +106,7 @@ def simple_update_checkbox_value(annot: DictionaryObject) -> None:
for each in annot[AP][D]: # noqa
if str(each) != Off:
annot[NameObject(AS)] = NameObject(each)
annot[NameObject(V)] = NameObject(each)
break


Expand Down

0 comments on commit 6cf724d

Please sign in to comment.