D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Data extraction from PDF form

 

On Sunday, 15 August 2021 09:15:28 BST Pentiddy wrote:
> 
> I am trying to make an application form and collate the data.
> I have managed to make a fillable PDF with Libre office writer, but I
> have been struggling to work out how to extract and collate the data
> from returned forms.
> 
> Has anyone done this with Libre Office?

Not until this evening.

The Python script on 

https://pdfminersix.readthedocs.io/en/latest/howto/acro_forms.html

read a quick test document I made with a "text box" for my name and a "button" 
(probably not needed), and a RadioGroup where I selected option 1.

python mine2.py 
Text Box 1 Simon
Push Button 1 None
RadioGroup1 1

I appreciate if you aren't up on Python, that probably didn't help much, but I 
couldn't find any sensible explanation of extracting Acroform data from PDFs. 
The script just prints key and value pairs, you could format as needed easily 
(e.g. add a colon after the key names etc). But need to write some Python to 
loop over files or pick arg1. Sure someone here might help if it is generally 
useful.

Libre Office can also save data in other formats or submit it to websites.

In my brief play I would describe doing this in Libre Office 7 as "hellish" 
compared to say learning web programming in Python.

If free software is important to you (and we hope and assume it is - otherwise 
Google forms) but you want a comprehensive online form builder with little 
effort on your part try: 

https://form.io 

it can even make and handle PDFs if PDFs is a given but try not to do that, 
the recipients and you will be happier, as it involves people emailing PDFs 
around, opening untrusted documents etc.

Signup for the free trial, and on the first screen is a stand alone form option 
(all the dev stuff is for developers and can be safely ignored).

If you want something less comprehensive there are some great free software 
WordPress plugins for form builders, and for other CMSs.



-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dcglug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq