PDDocumentCatalog catalog = pdDocument.getDocumentCatalog();
PDMetadata meta = catalog.getMetadata();
if (meta != null)
{
XMPMetadata metadata = meta.exportXMPMetadata();
XMPSchemaDublinCore dc = metadata.getDublinCoreSchema();
if (dc != null)
{
try
{
if (dc.getTitle() != null)
props.put(DCMetaData.TITLE, fixEncoding(dc.getTitle()));
}
catch (Exception e)
{
log.warn("getTitle failed: " + e);
}
try
{
if (dc.getDescription() != null)
props.put(DCMetaData.SUBJECT, fixEncoding(dc.getDescription()));
}
catch (Exception e)
{
log.warn("getSubject failed: " + e);
}
try
{
if (dc.getCreators() != null)
{
List<String> list = dc.getCreators();
for (String creator : list)
{
props.put(DCMetaData.CREATOR, fixEncoding(creator));
}
}
}
catch (Exception e)
{
log.warn("getCreator failed: " + e);
}
try
{
if (dc.getDates() != null)
{
List<Calendar> list = dc.getDates();
for (Calendar date : list)
{
props.put(DCMetaData.DATE, date);
}
}
}
catch (Exception e)
{
log.warn("getDate failed: " + e);
}
}
XMPSchemaBasic basic = metadata.getBasicSchema();
if (basic != null)
{
try
{
if (basic.getCreateDate() != null)