-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formwrapper cannot fill Checkbox #558
Comments
Hello, first of all thanks for contributing! Before we get into the actual coding part, I'm not sure if this issue is reproducible:
|
Hello @chinapandaman, I am using Adobe Acrobat reader to display the pdf. This seems weird that it would work on Chrome but not with Acrobat. Maybe that Acrobat is more severe regarding pdf structure than Chrome? |
Hmm interesting OK. I mean I don't have Acrobat on my current machine but I believe you. Plus the changes you are making are minor. So here are some next steps:
Let me know if you have any question regarding the above. |
Actually nvm about what I said above. I will just put up a PR in that branch. |
Hey buddy! So I've a made a few tests, starting back with a fresh install in a new venv. I am using python3.11. Your package has been installed through pip and its version is 1.4.17. Using this code: from PyPDFForm import FormWrapper
filled = FormWrapper("sample_template.pdf").fill(
{
"test": "Test 1",
"check": True,
},
)
with open("output.pdf", "wb+") as output:
output.write(filled.read())
filled = FormWrapper("verordnungsformular_4f.pdf").fill(
{
"LiMA": True,
"NomPrénom 1": "73VW"
},
)
with open("output2.pdf", "wb+") as output:
output.write(filled.read()) In Acrobat reader, here's the sample pdf without modifications: After filling it with the non-patched version of your package: It seems that now the checkbox is working but not the text field. I don't understand what's going on here. Opening the same document in a chromium based browser seem to work: Testing the same with the prescription form: No modifications, Acrobat: After filling it, Acrobat: After filling it, Chromium: I can't reproduce the bug with the checkboxes but now it happens with the text boxes. Could this be a problem in acrobat? I don't really know. I can't remember updating it this week so this might not be related to it. Feel free to close this issue as this might not be a problem anymore. If you wish, I can open a new one regarding the text fields. Sorry for the inconvenience. |
So a bit more about the text not showing up unless clicked issue. This is actually less surprising than checkbox not showing up. If you take a look at how GitHub displays say this PDF you will see that texts don't show up there either. To add a bit more context, when I initially started writing this library, it worked similar to how And the reason why what is now So you may ask, why is So enough history lessons. Here are some next steps:
|
Hello there,
It seems like the FormWrapper cannot fill checkbox.
Sample code to test with the sample pdf:
First checkbox stays unchecked.
The text was updated successfully, but these errors were encountered: