Extract metadata from Microsoft Office PowerPoint presentations

What is PowerPoint metadata?

PowerPoint metadata is like a “digital label” attached to your presentation files. It contains information about the file such as:

  • Who created it
  • When it was made
  • The title and subject
  • How long someone spent editing it
  • Which version of PowerPoint was used

Think of it like the “Properties” you see when you right-click on a file - but now you can extract this information programmatically using Java code.

Why extract PowerPoint metadata?

Here are some common reasons developers extract metadata from PowerPoint files:

  • File organization: Automatically sort presentations by author, date, or company
  • Document tracking: Find out who last modified a presentation and when
  • Content management: Build searchable libraries of presentations
  • Compliance: Track document history for auditing purposes

Available metadata information

The getMetadata method can extract these details from PowerPoint presentations:

NameWhat it tells you
titleThe presentation title
subjectWhat the presentation is about
keywordsTags or keywords for the presentation
commentsAny comments added to the presentation
content-statusThe content status of the presentation
categoryThe category of the presentation
companyThe company name associated with the file
managerThe manager associated with the presentation
authorWho created the presentation
last-authorWho last saved the presentation
hyperlink-baseThe base string used for evaluating relative hyperlinks in the presentation
applicationWhich application created the presentation
application-versionThe version of the application that created it
created-timeWhen the presentation was first created
last-saved-timeWhen someone last saved changes
last-printed-timeWhen the presentation was last printed
revision-numberHow many times the file has been revised
total-editing-timeHow many minutes were spent editing

Properties that are empty in the presentation are not included in the result.

How to extract the metadata

It’s really simple! Just follow these 3 steps:

Step 1: Create a Parser

First, instantiate the Parser object for your PowerPoint file:

try (Parser parser = new Parser("your-presentation.pptx")) {
    // Your code goes here
}

Step 2: Get the metadata

Call the getMetadata method to obtain the collection of MetadataItem objects:

Iterable<MetadataItem> metadata = parser.getMetadata();

Step 3: Read the information

Loop through the results and print out what you found:

for (MetadataItem item : metadata) {
    System.out.println(item.getName() + ": " + item.getValue());
}

Complete example

Here’s the full working example:

// Create an instance of Parser class
try (Parser parser = new Parser(Constants.SamplePptx)) {
    // Extract metadata from the presentation
    Iterable<MetadataItem> metadata = parser.getMetadata();
    // Iterate over metadata items
    for (MetadataItem item : metadata) {
        // Print an item name and value
        System.out.println(String.format("%s: %s", item.getName(), item.getValue()));
    }
}

What file types work?

This works with all common PowerPoint formats:

  • .ppt - Older PowerPoint files
  • .pptx - Newer PowerPoint files
  • .pps - PowerPoint slideshow files
  • .ppsx - Newer slideshow files

Important notes

Warning
getMetadata method returns null value if metadata extraction isn’t supported for the document. For example, metadata extraction isn’t supported for TXT files. Therefore, for TXT file getMetadata method returns null. If Microsoft Office PowerPoint presentation has no metadata, getMetadata method returns an empty collection.

Real-world example

Let’s say you have a folder full of PowerPoint presentations and you want to find out who created each one:

try (DirectoryStream<Path> presentations = Files.newDirectoryStream(Paths.get("C:\\MyPresentations"), "*.pptx")) {
    for (Path presentation : presentations) {
        try (Parser parser = new Parser(presentation.toString())) {
            String author = "Unknown";
            Iterable<MetadataItem> metadata = parser.getMetadata();
            if (metadata != null) {
                for (MetadataItem item : metadata) {
                    if ("author".equals(item.getName())) {
                        author = item.getValue();
                    }
                }
            }

            System.out.println("File: " + presentation.getFileName());
            System.out.println("Author: " + author);
            System.out.println("---");
        }
    }
}

This will show you the author of each PowerPoint file in your folder!

Common use cases

For businesses:

  • Track which employee created which presentation
  • Find presentations by topic or keyword
  • Monitor when presentations were last updated

For developers:

  • Build document management systems
  • Create automated file organizing tools
  • Add search functionality to presentation libraries

For content managers:

  • Organize presentation libraries
  • Track document versions and changes
  • Ensure proper attribution and ownership

Troubleshooting

Problem: Getting no metadata back?

  • Solution: The file might not have metadata, or the file format doesn’t support metadata extraction (in this case getMetadata returns null)

Problem: Can’t read the file?

Problem: Getting an error?

  • Solution: Check that the file isn’t corrupted and is a valid PowerPoint file

More resources

GitHub examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free online document parser App

Along with full featured Java library we provide simple, but powerful free Apps.

You are welcome to parse documents and extract data from PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, Emails and more with our free online Free Online Document Parser App.

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.