[reportlab-users] Fillable Fields

Robin Becker robin at reportlab.com
Fri Mar 23 13:01:59 EDT 2018


On 23/03/2018 16:43, Tim Roberts wrote:
> I have a need to put fillable fields on a PDF document.  Andy mentioned
> a decade ago that you had experimented with that, but was anything ever
> done about it?
> 
> Does anyone have a hack to add fillable fields in a ReportLab solution?
> 

We have most of the fillable fields worked out. I did a new version which mostly uses simple python code.

You can see the test code for canvas.acroForm in the reportlab source here

https://bitbucket.org/rptlab/reportlab/src/tip/tests/test_pdfbase_pdfform.py?at=default&fileviewer=file-view-default

The main thing I failed to realize when doing much of this is that the widgets are mostly drawn by the renderer when in use so I 
was chasing shadows trying to model Acrobat Reader's look and feel.

The code that implements the new form stuff  is here

https://bitbucket.org/rptlab/reportlab/src/tip/src/reportlab/pdfbase/acroform.py?at=default&fileviewer=file-view-default

I haven't implemented any javascript stuff properly so validation is probably a bit vacuous.
-- 
Robin Becker


More information about the reportlab-users mailing list