View Source

h3. 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.
{code}
// 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";
}
{code}

The source-code for this example is located at:
* [http://sventon.icesoft.org/svn/repos/repo/list/icepdf/trunk/icepdf/examples/capture/extraction/metadata/].

A primer on using Maven or Gradle build commands can be found [here (Maven)| http://www.icesoft.org/wiki/display/PDF/Maven+Build] and [here (Gradle)| http://www.icesoft.org/wiki/display/PDF/Gradle+Build]