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.getMessage());
}
try
{
if (dc.getDescription() != null)
props.put(DCMetaData.DESCRIPTION, fixEncoding(dc.getDescription()));
}
catch (Exception e)
{
LOG.warn("getSubject failed: " + e.getMessage());
}
try
{
if (dc.getCreators() != null)
{
for (String creator : dc.getCreators())
{
props.put(DCMetaData.CREATOR, fixEncoding(creator));
}
}
}
catch (Exception e)
{
LOG.warn("getCreator failed: " + e.getMessage());
}
try
{
if (dc.getDates() != null)
{
for (Calendar date : dc.getDates())
{
props.put(DCMetaData.DATE, date);
}
}
}
catch (Exception e)
{
LOG.warn("getDate failed: " + e.getMessage());
}
}
XMPSchemaPDF pdf = metadata.getPDFSchema();
if (pdf != null)
{
try
{
if (pdf.getKeywords() != null)
props.put(DCMetaData.SUBJECT, fixEncoding(pdf.getKeywords()));
}
catch (Exception e)
{
LOG.warn("getKeywords failed: " + e.getMessage());
}
try
{
if (pdf.getProducer() != null)
props.put(DCMetaData.PUBLISHER, fixEncoding(pdf.getProducer()));
}
catch (Exception e)
{
LOG.warn("getProducer failed: " + e.getMessage());
}
}
XMPSchemaBasic basic = metadata.getBasicSchema();
if (basic != null)
{
try
{
if (basic.getCreateDate() != null)