-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
PDF writing not filling the Dropdown #2611
Comments
Please provide the details the issue template requests from you, especially the code you used and a PDF for further analysis. |
The pdf write command I used is as follows. from pypdf import PdfReader, PdfWriter
reader = PdfReader(input_pdf)
writer = PdfWriter()
page = reader.pages[0]
writer.append(reader)
writer.update_page_form_field_values(
writer.pages[0],
{
"State": 'MN'
}
) the result from
Thanks |
can you also share the PDF please |
Writer is the modified document, with the fields updated. Reader is the original one : there is no link between |
I didn't get exactly what you meant. If you can provide little bit more explanation, it will be great. Thanks |
the updated field is part of writer: |
Yes writer.get_fields()["State"] returns with Data in '/V' but it is not showing in PDF. But I see data in Print Preview. Is there anything to do to get it showed on PDF rendering |
This issue only when open in Adobe Acrobat. Works fine in browsers |
local copy for test: |
At least during my tests, pdf.js would not render this correctly, while Okular does. |
Thank you for working on this. |
Same PDF update has some other issues as well I encountered. The same PDF has 2 pages and second page has some fields repeating but in the reader.get_fields() returns the fields only one time. But the update_page_form_field_values is not updating the field from second page |
I see only one field on second page (description) |
Ok Got it. Thank you for the reply. |
I am very new to python and PyPDF so asking. From above conversations I understand that you had a solution for the Acrobat issue with Dropdown. I see you created the PR and merged. But how can I get that changes |
You can either install the latest main version from GitHub or wait for us to publish the next release to allow you to install the package from PyPI (in the past, we usually did a release once a month). |
To complete @stefan6419846 you can install the current dev version as shown in the documentation: |
Thank you for the reply |
can you provide the filled document |
Two issues facing in this filled document is the font size in some fields and I am encrypting the writer pdf with User access permission for PRINT only. With PRINT only UAP the fields are READ ONLY, but there is a Signature field which looks like editable but not able to click or add signature in the file. Thank you |
Setting PRINT only, you have unset the permission "can fill in form fields". Therefore you can not edit any fields. The signature field is not filled however Acrobat seems to set the finger cursor on it (to possibly access some verification popups???) but the field is definitely empty |
Thank you for the reply. I may need to make each field read only to excluding signature to solve this right |
I am working on updating the editable PDF value using pypdf 4.2.0.
I am able to fill all the text fields . Having trouble filling the dropdown field.
Any specific method to do it?
The text was updated successfully, but these errors were encountered: