Read data from a form

Using writer, I have created a questionnaire form and saved it as a pdf. This works very well - the answer fields are editable, but everything else is read-only. The idea is that the user would return the completed form (electronically) and I would read the results and add to a database.
Using a macro I could extract fields from .odt, but the form has to be portable, so .odt is unfortunately unsuitable.
Can this be done with pdf, or .doc at a pinch?

1 Like

Hello @Pansmanser ! Could you please upload a sample .odt file?
MS Word (at least starting from version 2016) can work with .odt files. I can test the sample file in 2016 and 2019 versions.
There may be other options, of course.

Many PDF readers have the possibility of export forms data (content) from the .pdf file to many formats, some of them are .fdf, .xml and, may be, .txt or csv. If you export to csv or txt you can read the data with Calc or, may be, import data into Base directly. The two PDF readers I have tested, both have the possibility of export a batch of files (many files in one step).

@sokol92 , the attached file is an example. I would convert it to pdf and send it to a user, who would complete and return it.

pdf.odt (18.1 KB)

Thanks, @jucasaca That may be the best solution. The conversion can also be done online. I’ll try it.

Thanks for the informative example.
Alas, I could not find an option for conveniently filling out your questionnaire using MS Word, so the option with the PDF format, in my opinion, seems to be the best.
If you open a .pdf file in LO, then the file is opened as a LibreOffice Draw document, and the information entered by the user can be processed using macros.

  • No - the features of writer/LibreOffice are not available in the pdf.

  • Yes, this can be solved in PDF, using Javascript, but you won’t get help by LibreOffice. Scribus can embed Javascript, but yoz wil have to provide the code.

  • No clue on .doc/.docx but I guess: Same restriction as on .odt. No vba in .odf.

My solution has been to conduct the questionnaire online (Google sheets), then copy and paste the data into a Base table. It should be possible to read from Google, but I the methods suggested don’t work adequately, if at all.