Filling PDF Forms In Python — The Right Way
Jan Chęć

Very useful post, jsut what I needed for a project I’m working on. Just two things:

First, a correction. The name of the field, as set while creating the form, is in field.TU, and surrounded by brackets. So a field named “name” has a property field.TU == ‘(name)’.

And second, an update. I have tried pdfrw version 0.3, and method 3 works! So you can assign a value to a form field as in the example. A little correction here: assign the value without brackets. Like this: template.Root.Pages.Kids[0].Annots[3].update(pdfrw.PdfDict(V='test'))

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.