Replies: 24 comments
-
Please provide all mandatory information. Currently there is no script, nor reproducer file, nor OS / PyMuPDF versions. |
Beta Was this translation helpful? Give feedback.
-
Yep just finished typing to update the issue. |
Beta Was this translation helpful? Give feedback.
-
Ah, ok, thank you. |
Beta Was this translation helpful? Give feedback.
-
Cannot reproduce: works correctly on Adobe, evince (Linux), Mozilla, MS Edge browser. |
Beta Was this translation helpful? Give feedback.
-
Hi, I forgot the widget.update() in the code example of the issue but not in my code. Regards, Seb. |
Beta Was this translation helpful? Give feedback.
-
I believe you, no worries 😎. But as all other viewers do work, including the de-facto standard Adobe, and including evince on Linux, it must be a problem specific to Mac. |
Beta Was this translation helpful? Give feedback.
-
isn't there an option to make the checkboxes visible? |
Beta Was this translation helpful? Give feedback.
-
It seems that is not the problem - instead I believe that these viewers do not accept the checkbox as being valid at all. Just thought about it again - maybe the following does help. And if it does, we could add a fix for the next version: Add the following instruction after the widget.update(): widget.field_value = True
widget.update()
doc.xref_set_key(widget.xref, "V", "/Yes") Please leet me know if this helps. |
Beta Was this translation helpful? Give feedback.
-
It's not working with doc.xref_set_key(widget.xref, "V", "/Yes") |
Beta Was this translation helpful? Give feedback.
-
No error messages or anything? print(doc.xref_object(widget.xref)) |
Beta Was this translation helpful? Give feedback.
-
before /Subtype /Widget /AP << /T (INI) after /Subtype /Widget /AP << /T (INI) |
Beta Was this translation helpful? Give feedback.
-
Well, Oui = French for Yes is grotesquely wrong 😂! No idea how you managed to get this into the PDF. So you may want to try either |
Beta Was this translation helpful? Give feedback.
-
It is an official pdf from french administration xD |
Beta Was this translation helpful? Give feedback.
-
Good to know it's not your fault 😁. |
Beta Was this translation helpful? Give feedback.
-
It's not working either with doc.xref_set_key(widget.xref, "V", "/Yes") or doc.xref_set_key(widget.xref, "V", "(Yes)") |
Beta Was this translation helpful? Give feedback.
-
In the pdf form, "Oui" is the exported value for the checkbox, then I suppose you can have the values you prefer for the checkboxes. if I change it to Yes it will work ? I changed the value in the pdf form Oui to Yes and it still not displayed with safari. |
Beta Was this translation helpful? Give feedback.
-
I would not bet my personal whealth on this, but yes, I believe so. |
Beta Was this translation helpful? Give feedback.
-
I changed the value in the pdf form Oui to Yes and it still not displayed with safari. |
Beta Was this translation helpful? Give feedback.
-
the checkbox is valid : in the before print of my previous export : the /AS is /Yes before and after, only the /V have the value Oui. /V can have the value you want with pdf adobe acrobat pro forms when you create the form. |
Beta Was this translation helpful? Give feedback.
-
Ok, I think it is clear, that we don't have an PyMuPDF issue here. So I am going to convert this to a "Discussions" item, where we can continue evaluating options... |
Beta Was this translation helpful? Give feedback.
-
but it's working with pdftk, why it's not working with pymupdf, I think it's an issue with pymupdf because the checkboxes are working on mac with the others softwares. I am creating a new pdf form with adobe acrobat pro, a simple form with only one checkbox and one textfield and I will do the test with this new pdf : |
Beta Was this translation helpful? Give feedback.
-
Do you have a "Need Appearances flag" option for the checkboxes ? |
Beta Was this translation helpful? Give feedback.
-
Then I tried with this new pdf and It's working then maybe the issue is with the pdf but I don't know what to change. |
Beta Was this translation helpful? Give feedback.
-
I removed the checkboxes from the pdf and added them again and now it's working, thanks a million for your help. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug (mandatory)
Checked Checkboxes on Safari and mac os viewer are not displayed
To Reproduce (mandatory)
from fitz import fitz
with fitz.open(pdffilename) as doc:
for page in doc:
widgets = page.widgets()
for widget in widgets:
widget.field_value = True
doc.save(pdfoutputfilename)
Expected behavior (optional)
checkbox checked on safari and mac os viewer
Your configuration (mandatory)
Mac Os Ventura 13.3.1
For example, the output of
print(sys.version, "\n", sys.platform, "\n", fitz.__doc__)
would be sufficient (for the first two bullets).3.11.3 (v3.11.3:f3909b8bc8, Apr 4 2023, 20:12:10) [Clang 13.0.0 (clang-1300.0.29.30)]
darwin
PyMuPDF 1.22.3: Python bindings for the MuPDF 1.22.0 library.
Version date: 2023-05-10 00:00:01.
Built for Python 3.11 on darwin (64-bit).
Beta Was this translation helpful? Give feedback.
All reactions