How to Read Metadata from Multiple PDFs with Acrobat JavaScript
Question details
The user needs to extract metadata from multiple PDF files automatically using scripting in Adobe Acrobat Pro DC.

- Product
- Adobe Acrobat Pro DC
- Device & OS
- not provided
- Scenario
- Running a batch process across multiple PDF files to programmatically extract and read document properties like Author, Title, and Subject.
- Observed behavior
- Requires a method to design and execute a JavaScript batch process to automate metadata reading for a specific file workflow.
Ensure you have Adobe Acrobat Pro DC installed, as the Action Wizard and advanced batch JavaScript processing features are not available in the standard Acrobat Reader.
Use Action Wizard to Run a Custom JavaScript Batch Process
Create an automated batch process using the Acrobat Action Wizard to execute a custom JavaScript on an entire folder of PDFs, allowing you to extract standard or custom document properties.
Adobe Acrobat Pro DC includes an Action Wizard feature designed for applying automated scripts across multiple files. By injecting a custom JavaScript into an Action, you can loop through a designated folder and read metadata such as Title, Author, Subject, and Keywords using the 'this.info' object.
Launch Adobe Acrobat Pro DC. Go to the 'Tools' tab and select 'Action Wizard' from the Customize section.
Click on 'New Action' in the Action Wizard toolbar. Under 'Files to be Processed', click 'Add Folder' and select the directory containing your PDF files.
In the 'Choose tools to add' pane on the left, expand 'More Tools', select 'Execute JavaScript', and click the '+' button to add it to your action steps on the right.
Click 'Specify Settings' on the newly added Execute JavaScript step. Input your custom script to read metadata (e.g., accessing 'this.info.Title' and 'this.info.Author') and output it to the console or a file. Click 'OK'.
Save the Action with a recognizable name like 'Extract PDF Metadata'. Click on the saved action in the Action List and press 'Start' to process all PDFs in the selected folder.

Need a simpler way to view and manage PDF metadata? Try WPS Office
While advanced automated scripting requires expensive Adobe Acrobat Pro subscriptions, WPS Office provides a lightweight, cost-effective, and highly intuitive alternative. It allows you to seamlessly view, edit, and manage PDF document properties alongside full compatibility with Word, Excel, and PowerPoint formats without requiring any complex coding.
- 1. Open your PDF in WPS Office: Launch WPS Office and open your PDF document using the robust built-in PDF editor.
- 2. Access Document Properties: Click on 'Menu' in the top-left corner, navigate to 'Document Properties', or use the relevant shortcuts.
- 3. View and Modify Metadata: In the Properties window, you can instantly view and edit metadata such as Title, Author, Subject, and Keywords without writing any scripts.

Frequently Asked Questions
Can I extract custom metadata fields using Acrobat JavaScript?
Yes, Acrobat JavaScript can access standard metadata using the 'this.info' object, and it can also read custom properties defined in the document by referencing 'this.info.YourCustomFieldName'.
Do I need Adobe Acrobat Pro to run batch JavaScripts on PDFs?
Yes. The Action Wizard and the ability to execute folder-level batch JavaScript processes are exclusive features of Adobe Acrobat Pro DC and are not supported in the free Acrobat Reader.
Where does the extracted metadata go when running the script?
Unless specifically programmed otherwise using trusted functions, the extracted metadata is typically printed to the Acrobat JavaScript Console. Writing to an external file like an Excel or CSV document requires elevated security privileges and specialized scripting.




