• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Jun 13, 2018 Jun 13, 2018

Copy link to clipboard

Copied

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!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

392

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 14, 2018 Jun 14, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2018 Jun 19, 2018

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2018 Jun 19, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2018 Jun 19, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2018 Jun 19, 2018

Copy link to clipboard

Copied

LATEST

You can create the text like this:

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

and add it to the report.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines