t-houssian / fillpdf

A python library to make filling pdfs much easier
MIT License
134 stars 23 forks source link

'Check Box': 'Yes' does not check boxes in PDF. #25

Open nathanramoscfa opened 2 years ago

nathanramoscfa commented 2 years ago

SOLUTION: Instead of 'Yes', it is 'On'. PLEASE UPDATE THE DOCUMENTATION.

The docs on checking off boxes are shown below. 'Yes' did not work to check boxes within my PDF. Purely by accident, I found the solution is actually 'On'. Now the appropriate check box in my PDF is checked off.

data_dict = {'Address 1 Text Box': '500 West Main Street',
'Driving License Check Box': 'On',
'Language 1 Check Box': 'On',}

fillpdfs.write_fillable_pdf('blank.pdf', 'new.pdf', data_dict)
Kucki2018 commented 1 year ago

'On' checked your checkbox off? For me, it is only putting a border/edge around the check box (no "x" or tick).

Edit: '1' works for me

michel-meneses commented 5 months ago

The solution I found for that issue was to manually check the box, save the file, and read its fields using fillpdfs.get_form_fields. Then, I verified the value in the checkbox field, which in my case was 'Ja'.