-
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
File does not seem to be saved #1903
Comments
@bobweasel |
It's not working, setting the value to |
Just looking around for similar issue and tried your example. |
@kubaPod Can you publish your output pdf ? |
@pubpub-zz sure: generated with: from pypdf import PdfReader, PdfWriter
reader = PdfReader("1.pdf")
writer = PdfWriter()
page = reader.pages[0]
fields = reader.get_fields()
writer.append(reader)
writer.update_page_form_field_values(
writer.pages[0], {
"Given Name Text Box": "asdf",
"Family Name Text Box": "fam",
"Address 1 Text Box": "add1",
"House nr Text Box": "2",
"Address 2 Text Box": "add2",
"Postcode Text Box": "123456",
"City Text Box": "city",
"Country Combo Box": "Belgium",
"Gender List Box": "Man",
"Height Formatted Field": "30",
"Driving License Check Box": "/Yes", # also changed
"Favourite Colour List Box": "Black",
"Language 1 Check Box": "/Yes",
"Language 2 Check Box": "/Off",
},
auto_regenerate = False
)
# write "output" to pypdf-output.pdf
with open("filled-out.pdf", "wb") as output_stream:
writer.write(output_stream) |
@bobweasel |
Hmm might be something to do with the file policy? I can't post the PDF here due to confidentiality reasons, but the problem still persist. See if someone else encounters it. |
Can you send it to @MartinThoma info@martin-thoma.de by mail? |
@bobweasel : +1? |
I'm closing this issue until you can send the pdf else nothing can be done |
@pubpub-zz just sent to the indicated email |
@bobweasel the PR is available if you want to test. I've observed an odd result when filling the form : the spacing is not respecting the 'cases' : the current appareance we are generating does not cope with comb flag. I will open a new PR with a free form for people to help to find how to do it |
After performing the write, I opened it in Adobe Acrobat Pro DC, and saw the edits are applied. However, when I try to close the file, I am promoted to save the file. If I click no, I would be prompted every time I open and close the file. However, when I try to attach the file in an email and preview it, the edits are no longer visible. This is solved by clicking yes on the save dialog instead, and I noticed that the file size increases after that.
Environment
Which environment were you using when you encountered the problem?
$ python -m platform Windows-10-10.0.19044-SP0 $ python -c "import pypdf;print(pypdf.__version__)" 3.10.0
Code + PDF
This is a minimal, complete example that shows the issue:
Share here the PDF file(s) that cause the issue. The smaller they are, the
better. Let us know if we may add them to our tests!
http://foersom.com/net/HowTo/data/OoPdfFormExample.pdf
Traceback
This is the complete Traceback I see:
No traceback
The text was updated successfully, but these errors were encountered: