Metadata Extraction

Table of Contents

Metadata Extraction

The Metadata Extraction example will extract data from the documents Info dictionary. This data includes but is not limited to document title and author.

// get document information values if available
PInfo documentInfo = document.getInfo();
if (documentInfo != null) {
    title = documentInfo.getTitle();
    author = documentInfo.getAuthor();
    subject = documentInfo.getSubject();
    keyWords = documentInfo.getKeywords();
    creator = documentInfo.getCreator() != null ?
            documentInfo.getCreator() : "Not Available";
    producer = documentInfo.getProducer() != null ?
            documentInfo.getProducer() : "Not Available";
    creationDate = documentInfo.getCreationDate() != null ?
            documentInfo.getCreationDate().toString() : "Not Available";
    modDate = documentInfo.getModDate() != null ?
            documentInfo.getModDate().toString() : "Not Available";
}

The source-code for this example is located at:

A primer on using Maven or Gradle build commands can be found here (Maven) and here (Gradle)

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2017 ICEsoft Technologies Canada Corp.