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

Want to extract document metadata and doc info via a script

New Here ,
Apr 25, 2016 Apr 25, 2016

Copy link to clipboard

Copied

I'm not a Javascript nor Java programmer so I might be missing one or more steps.

Looking at the Javascript info I have I see the following code:

var r = new Report();

r.writeText(this.metadata);

r.open("myMetadataReportFile");

save("/c/myreport.pdf"));

The code doesn't seem to be working when run from the console. If I execute "this.metadata" I get the information that I expect. This suggests that the problem is with report creation and or saving the document.

I haven't yet figured out how to get information out of the Doc Info dictionary.  This is another need.

NOTE: In both cases (XMP and DocInfo) we're adding CUSTOM metadata.

Ideally I'd like to save both sets of information XMP and DocInfo as XML . This way we can run a comparison between the two.

Finally whatever code I end-up with needs to be able to run in the Action Wizard over about 10,000 files. If the input file is "file.pdf" the output should be "file.xml"

Thanks.

Ira

TOPICS
Acrobat SDK and JavaScript , Windows

Views

4.1K

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

correct answers 1 Correct answer

Community Expert , Apr 26, 2016 Apr 26, 2016

To run multiple lines in the console you need to select them all with the

mouse and then press Ctrl+Enter.

Later on you can place the code as a part of an Action and run it like

that, yes.

The "metadata" property should return the full XMP file, including any

custom properties.

Votes

Translate

Translate
New Here ,
May 05, 2016 May 05, 2016

Copy link to clipboard

Copied

LATEST

Thanks for the recommendation of Notepad++. I'm not sure if my IT department will let me add it.

I did discover, as you hinted at, that the problem does lie with "saveAs". If you change the code to "com.adobe.acrobat.accesstext" I get the new lines as I need. NOTE: Previously the converter ended in in "plain-text".

Thanks again.

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