{'check': <PyPDFForm.lib.middleware.checkbox.Checkbox object at 0x10b6086e0>,
'check_2': <PyPDFForm.lib.middleware.checkbox.Checkbox object at 0x10b5fcb90>,
'check_3': <PyPDFForm.lib.middleware.checkbox.Checkbox object at 0x10b5fce10>,
'test': <PyPDFForm.lib.middleware.text.Text object at 0x10b4af8c0>,
'test_2': <PyPDFForm.lib.middleware.text.Text object at 0x10b5fca50>,
'test_3': <PyPDFForm.lib.middleware.text.Text object at 0x10b5fccd0>}
{'check': Checkbox(name='check', value=None, readonly=False, required=False, hidden=False, page_number=1, x=358.874, y=664.717, width=18.47999999999996, height=18.480000000000018),
'check_2': Checkbox(name='check_2', value=None, readonly=False, required=False, hidden=False, page_number=2, x=349.637, y=673.954, width=18.478999999999985, height=18.480000000000018),
'check_3': Checkbox(name='check_3', value=None, readonly=False, required=False, hidden=False, page_number=3, x=349.305, y=667.344, width=18.480000000000018, height=18.479999999999905),
'test': Text(name='test', value=None, readonly=False, required=False, hidden=False, page_number=1, x=73.3365, y=662.692, width=232.4235, height=21.067999999999984, comb=False, multiline=False),
'test_2': Text(name='test_2', value=None, readonly=False, required=False, hidden=False, page_number=2, x=71.4095, y=671.626, width=232.42350000000005, height=21.067999999999984, comb=False, multiline=False),
'test_3': Text(name='test_3', value=None, readonly=False, required=False, hidden=False, page_number=3, x=70.5919, y=665.349, width=232.42309999999998, height=21.067999999999984, comb=False, multiline=False)}
Version
PyPDFForm=4.7.10
Issue Description
Add a
__repr__method to theWidgetbase class so that individual widgets and thepdf.widgetsdictionary render meaningfully in interactive sessions and debug output.Currently, inspecting
pdf.widgetsor a single widget produces an unhelpful default object repr. After this change, each widget displays its class name,name,value, and all non-Nonepublic attributes, omitting internal bookkeeping fields (SET_ATTR_TRIGGER_HOOK_MAP,attr_set_tracker,hooks_to_trigger).Code Snippet
Example output:
before changes
desired output:
PDF Form Template
sample_template.pdf