fillpdf icon indicating copy to clipboard operation
fillpdf copied to clipboard

Error on write_fillable_pdf

Open 0000F8 opened this issue 1 year ago • 1 comments

fillpdfs.write_fillable_pdf('input.pdf', 'new.pdf', data_dict)

File "/opt/homebrew/lib/python3.11/site-packages/fillpdf/fillpdfs.py", line 295, in write_fillable_pdf template_pdf.Root.AcroForm.update(pdfrw.PdfDict(NeedAppearances=pdfrw.PdfObject('true'))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'update'

Not sure where it's going wrong.

Just using a standard tax document

data_dict = {
'f1_1[0]': 'Wakka',
}

fillpdfs.write_fillable_pdf('input.pdf', 'new.pdf', data_dict)

0000F8 avatar Dec 08 '23 01:12 0000F8

The output from print_form_fields is something like this:

{'f1_1[0]': 'oouoiuuoi', 'f1_2[0]': 'opuoiuop', 'f1\1373\1330\135': '', 'f1_4[0]': 'Buzz Lightyear', }

What are those unicode escape characters as well?

0000F8 avatar Dec 08 '23 01:12 0000F8