Skip to content
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

Skipping certain fields when trying to get the data_dict fillpdfs.get_form_fields(pdf, sort=True, page_number=1) #34

Open
drswapnil opened this issue Aug 3, 2022 · 2 comments

Comments

@drswapnil
Copy link

Hi,
Great work. I am trying to design a PDF form to use with your script. However whenever i try to run the same, i am not able to get some of the fields to show up. Its skipping certain fields e.g name and MRD no. Can you pls help. I have attached both my python file and PDF form for reference.

Desktop new ECHS form.pdf

import fillpdf
from fillpdf import fillpdfs

fillpdfs.get_form_fields(pdf, sort=True, page_number=1)

fillpdfs.print_form_fields(pdf, sort=False, page_number=1)

# data_dict = {
#     "name": "Swapnil",
#     "mrd": "1234",
#     "age": "45",
#     "sex": "Female",
# }

fill text2 form fields with text
fillpdfs.write_fillable_pdf(pdf,pdf2, data_dict )

If you want it flattened:
fillpdfs.flatten_pdf(pdf2, 'newflat.pdf')

Running this gives -

Values From Page 1
Values From Page 1
{'Text4': '03-Aug-2022',
'Print': None,
'complaints': '',
'addmed': '5. Enfenac eye drops - 1 drop Two times per day - ',
'Text10': '04-Aug-2022',
'Text11': '06-Aug-2022',
'Text13': '24-Aug-2022',
'Text21': '10-Aug-2022',
'Text22': '11-Aug-2022',
'Text23': '17-Aug-2022',
'Text24': '18-Aug-2022',
'Text25': '24-Aug-2022',
'Text26': '25-Aug-2022',
'Text27': '01-Sep-2022',
'Text31': '01-Sep-2022',
'Text28': '07-Sep-2022',
'Text29': '08-Sep-2022',
'Text30': '14-Sep-2022',
'Text5': '01-Nov-2022'}

@drswapnil
Copy link
Author

Hi , a small update.. Its skipping the fields when it prints the fields but fills the pdf properly. So maybe a bug in detecting the fields but certainly works as it should. Thanks again for your work.

@fidoriel
Copy link

fidoriel commented Aug 15, 2022

I think this issue might be related to #pmaupin/pdfrw#84
For me it is filled when viewing in Acrobat, PDF-XChange or Chrome and Edge, but SumatraPDF does not. There are also some issues with Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants