Traceback (most recent call last):
File "/home/danilo/work/swikv3/radiob.py", line 14, in <module>
page.add_widget(widget)
File "/home/danilo/.local/lib/python3.10/site-packages/pymupdf/__init__.py", line 8477, in add_widget
widget.update()
File "/home/danilo/.local/lib/python3.10/site-packages/pymupdf/__init__.py", line 7151, in update
self._validate()
File "/home/danilo/.local/lib/python3.10/site-packages/pymupdf/__init__.py", line 7065, in _validate
self._checker() # any field_type specific checks
File "/home/danilo/.local/lib/python3.10/site-packages/pymupdf/__init__.py", line 6956, in _checker
kids_type, kids_value = doc.xref_get_key(self.xref, "Parent/Kids")
File "/home/danilo/.local/lib/python3.10/site-packages/pymupdf/__init__.py", line 5789, in xref_get_key
raise ValueError( MSG_BAD_XREF)
ValueError: bad xref
It does not happen if field_value is set to False.
I'm however able to update the value afterwards (commented code). Not sure if it is a bug or a "feature".
This is a non-implemented feature. Radio buttons are intended to be set on or off in conjunction with others in the same group.
PyMuPDF does not currently support RB groups - this is the reason for this error.
Description of the bug
I'm unable to create a RADIOBUTTON which is already checked:
gives the error:
It does not happen if
field_value
is set toFalse
.I'm however able to update the value afterwards (commented code). Not sure if it is a bug or a "feature".
How to reproduce the bug
Just by running the code
PyMuPDF version
1.24.3
Operating system
Linux
Python version
3.10