if (key instanceof String)
key = new PdfName((String) key);
if (PdfName.TITLE.equals(key)) {
xmpMeta.setLocalizedText(XMPConst.NS_DC, DublinCoreProperties.TITLE, XMPConst.X_DEFAULT, XMPConst.X_DEFAULT, value);
} else if (PdfName.AUTHOR.equals(key)) {
xmpMeta.appendArrayItem(XMPConst.NS_DC, DublinCoreProperties.CREATOR, new PropertyOptions(PropertyOptions.ARRAY_ORDERED), value, null);
} else if (PdfName.SUBJECT.equals(key)) {
xmpMeta.setLocalizedText(XMPConst.NS_DC, DublinCoreProperties.DESCRIPTION, XMPConst.X_DEFAULT, XMPConst.X_DEFAULT, value);
} else if (PdfName.KEYWORDS.equals(key)) {
for (String v : value.split(",|;"))
if (v.trim().length() > 0)
xmpMeta.appendArrayItem(XMPConst.NS_DC, DublinCoreProperties.SUBJECT, new PropertyOptions(PropertyOptions.ARRAY), v.trim(), null);
xmpMeta.setProperty(XMPConst.NS_PDF, PdfProperties.KEYWORDS, value);
} else if (PdfName.PRODUCER.equals(key)) {
xmpMeta.setProperty(XMPConst.NS_PDF, PdfProperties.PRODUCER, value);
} else if (PdfName.CREATOR.equals(key)) {
xmpMeta.setProperty(XMPConst.NS_XMP, XmpBasicProperties.CREATORTOOL, value);