public class ParseMetadata {
private static void parseMetadata() throws TransformerException, SAXException {
URL url = ParseMetadata.class.getResource("pdf-example.xmp");
Metadata meta = XMPParser.parseXMP(url);
XMPProperty prop;
prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "creator");
XMPArray array;
array = prop.getArrayValue();
for (int i = 0, c = array.getSize(); i < c; i++) {
System.out.println("Creator: " + array.getValue(i));
}
prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "title");
array = prop.getArrayValue();
System.out.println("Default Title: " + array.getSimpleValue());
System.out.println("German Title: " + array.getLangValue("de"));
prop = meta.getProperty(XMPConstants.XMP_BASIC_NAMESPACE, "CreateDate");
System.out.println("Creation Date: " + prop.getValue());
prop = meta.getProperty(XMPConstants.XMP_BASIC_NAMESPACE, "CreatorTool");
System.out.println("Creator Tool: " + prop.getValue());
prop = meta.getProperty(XMPConstants.ADOBE_PDF_NAMESPACE, "Producer");
System.out.println("Producer: " + prop.getValue());
prop = meta.getProperty(XMPConstants.ADOBE_PDF_NAMESPACE, "PDFVersion");
System.out.println("PDF version: " + prop.getValue());
DublinCoreAdapter dc = DublinCoreSchema.getAdapter(meta);
System.out.println("Default title: " + dc.getTitle());
System.out.println("German title: " + dc.getTitle("de"));