Examples-GroupDocs.Metadata-for-Java
// initialize PdfFormat
DocFormat docFormat = new DocFormat(Common.mapSourceFilePath(path));
// get DocMetadata
DocMetadata metadata = docFormat.getDocumentProperties();
// get metadata all metadata keys
String[] metadataKeys = metadata.getKeys();
for(String key: metadataKeys)
{
// check if metadata value is custom
if (!metadata.isBuiltIn(key))
{
// get metadata value by key
PropertyValue propertyValue = metadata.readPropertyValue(key);
// write value to output
System.out.printf("key: %s, type: %s, value: %s", key, propertyValue.getType(), propertyValue);
}
}