Unable to set any of button radio group in form #2333
-
Hi!
I don't see any change on any buttons state. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 12 replies
-
Can you please let me have the example file? |
Beta Was this translation helpful? Give feedback.
-
Update: Another thing I would like to do is further simplifying this: it should be sufficient to just do import fitz
doc=fitz.open("i-9-spanish.pdf")
page=doc[0]
w = page.load_widget(638)
w.button_states()
{'normal': ['3'], 'down': ['3', 'Off']} There two keys: "normal" and "down". Each value is a list of either length 1 or 2. If a list item is not "Off", then it is the value for the "On" state. This value is the one you must use as per today to set the on / True. |
Beta Was this translation helpful? Give feedback.
-
This is fixed in new release PyMuPDF-1.22.3. |
Beta Was this translation helpful? Give feedback.
-
Hi, I am running this and xref 716 works fine but on xref 82 I get an issue. The problem sees to be
File I used: Any suggestions on how I might fix this? |
Beta Was this translation helpful? Give feedback.
-
I'm also still having an issue with radio buttons. I have 2 in a document, and I can change almost any other property of the radio buttons without issue and see those changes reflected after a System info:
I have 2 radio buttons in a group, the only 2 on the page. Here is their info according to PyMuPDF: >>> fdoc = fitz.open(doc_path)
>>> page = fdoc.load_page(0)
>>> btn1 = page.load_widget(66)
>>> btn2 = page.load_widget(69)
>>> btn1.button_states()
{'normal': ['Off', '1'], 'down': None}
>>> btn2.button_states()
{'normal': ['Off', '2'], 'down': None}
>>> print(btn1.field_value, ", ", btn2.field_value)
Off, 2 This is how they read when I first export from LibreOffice Draw. Then I do the following: >>> btn2.field_value = 'Off'
>>> btn2.update()
>>> btn2.field_value
'Off' It appears to be off. However, when I save the file and open in any PDF viewer, Attaching the PDF in question as it has been exported from LibreOffice, before I run my PyMuPDF script on it: PDF viewers I've tested with: Firefox, Chrome, Edge, LaTeX/PDF viewer extenson in VSCodium, Adobe Acrobat Pro, Okular |
Beta Was this translation helpful? Give feedback.
Strange. I've been at this for a few hours and have been unsuccessful in getting those radios to both be in the off state. When I use the PDF that I uploaded initially here, I am still unable to get the results I expect. In fact, when I run the script it tells me that
btn2
value is2
andbtn1
value isOff
. I don't know why that discrepancy is there with seemingly the same file...However, I just made some edits to my source ODG file, and while running my script everything is working now.
The only times I get a failure now are:
btn1.field_value = "Off"
instead ofFalse
Setting th…