Skip to main content
Participant
June 13, 2018
Question

I would like to export form fields from a PDF and write them into predetermined gaps in a text file or similar.

  • June 13, 2018
  • 2 replies
  • 784 views

So I am supposed to aggregate tons of numbers from ~100 PDF forms I prepared in Acrobat Pro DC earlier and display them in tables in a Wordpress website. However, as I have to use the VisualComposer I need the table code to be quite specific, so I was wondering...as opposed to pressing CTRL+C/V a billion times:

can I somehow extract the form fields of a PDF (named "date1", "Amount1", "Amount2", "Amount3"...) and write them in a specific manner into a txt file? Such as:

[cq_vc_datatable_item data1="date1" data2="Amount1" data3="Amount2" data4="Amount3" data5="Amount4" data6="Amount5" data7="Amount6"]
[cq_vc_datatable_item data1="date2" data2="Amount7" data3="Amount8" data4="Amount9" data5="Amount10" data6="Amount11" data7="Amount12"]

where the "dateX" and "AmountX" are the actual numbers/inputs, of course?

I have no clue about JS unfortunately, but I guess I could hack my way from a script that pretty much does already extracts fields and writes them into "variables/placeholders" that match the field names in the PDF...

Would appreciate any help, but also any "not possible w/o getting deep into JS"-replies!

Many thanks!

This topic has been closed for replies.

2 replies

Bernd Alheit
Community Expert
Community Expert
June 19, 2018

You can create a report with the whole text and save it as text file.

Participant
June 19, 2018

Right, but I'd still have to copy&paste each field's content into the code above one by one. I was hoping there's a method where I can just say "add content of field xyz into variablexyz" and so on

Bernd Alheit
Community Expert
Community Expert
June 19, 2018

You can create the text like this:

  "[cq_vc_datatable_item data1=\"" + this.getField("date1") + "\" data2= ... ]"

and add it to the report.

BarlaeDC
Community Expert
Community Expert
June 14, 2018

Hi,

You should be able to use this.exportAsText to get a tab delimited file that you can then manipulate to make as you want.

As you have a large number of forms it would be best to run it as a batch.

This is probably the easiest option, once you have the file you could use numerous tools to be able to convert it to the format above, but I don't think you would be able to get it out of Acrobat that way.

Hope this helps

Malcolm

Participant
June 19, 2018

Thanks a lot! Will try to figure out how to write a script first, I guess

Any chance you know a tool with which I can achieve inserting the data into the suggested format? I have no idea...

Again thanks!