Skip to main content
Participant
May 10, 2016
質問

How to batch convert PDF to XML or flat text

  • May 10, 2016
  • 返信数 2.
  • 11012 ビュー

How to batch convert PDF to XML or flat text. I have several files that I want to have converted to xml or flat text data. ( I have about 450 files to convert ). I do have adobe acrobat PRO 10.0.

I tried using ACTION with output as Don't save changes and I have also tried saving to different folder - But neither are working

"Execute JavaScript" command with this code:

this.exportXFAData({ cPath: this.path.replace(/\pdf$/i, "xml"), bXDP: false});

Using Don't Save Changes - there did not appear to be any visible change - no timestamp change, no new files generated

Using Save to Folder - After each command run, it generated another PDF and not an xml or text document in the folder.

このトピックへの返信は締め切られました。

返信数 2

Inspiring
May 10, 2016

Did you try to run your line of JavaScript in the Acrobat JavaScript console on an open form created with Acrobat with completed form fields?

It worked without errors for me.

Tahishas作成者
Participant
May 10, 2016

I am not sure what you mean by "OPEN FORM CREATED WITH ACROBAT with completed form fields." If you are asking if my PDF's were generated off of an ADOBE form then no. My PDF's were created off emails. I am trying to obtain the history of some reporting that was only generated in an email for the last year and a half. I need to get them in any form of readable format all combined and I will write some code around it to get into the ideal format for my javascript webpage.

WHen I actually run this...

First file...

After it processes - I just get another PDF file.. instead of the XML file.

try67
Community Expert
Community Expert
May 10, 2016

If the form doesn't contain any actual form fields then you can't extract any form data from it.

What you can do is convert the entire file to a text file, using the saveAs method (specifying the cConvID parameter to "com.adobe.acrobat.plain-text").

try67
Community Expert
Community Expert
May 10, 2016

Are these LCD forms? Are there any error messages in the JS Console when

you run the Action?

Tahishas作成者
Participant
May 10, 2016

No these are not forms.. they are just PDF's... there are no errors, it is just not creating the files as expected.

Inspiring
May 10, 2016

Have you carefully read the Acrobat JS API Reference for the  exportXFAData.  You may need to  specify the aPackets parameter. So you also need to change bXDP to true.