{
// building temporary XMP metadata
DublinCoreSchema dc = metadata.createAndAddDublinCoreSchema();
AdobePDFSchema pdf = metadata.createAndAddAdobePDFSchema();
XMPBasicSchema xmp = metadata.createAndAddXMPBasicSchema();
// Writing info in XMP and Document Information dictionary
// TITLE
dico.setTitle("dicoTitle");
dc.setTitle("x-default", "XMPTitle");
// AUTHOR
dico.setAuthor("dicoAuthor");
dc.addCreator("XMPAuthor");
dc.addCreator("2ndCreator");
// SUBJECT
dico.setSubject("dicoSubj");
dc.addSubject("XMPSubj");
dc.addSubject("2ndSubj");
// KEYWORDS
dico.setKeywords("DicoKeywords");
pdf.setKeywords("XMPkeywords");
// CREATOR
dico.setCreator("DicoCreator");
xmp.setCreatorTool("XMPCreator");
// PRODUCER
dico.setProducer("DicoProducer");
pdf.setProducer("XMPProducer");
// CREATION DATE
dico.setCreationDate(Calendar.getInstance());
GregorianCalendar XMPCreate = new GregorianCalendar(2008, 11, 05);
xmp.setCreateDate(XMPCreate);
// MODIFY DATE
dico.setModificationDate(Calendar.getInstance());
GregorianCalendar XMPModify = new GregorianCalendar(2009, 10, 15);
xmp.setModifyDate(XMPModify);
// Launching synchronization test
try
{
ve = sync.validateMetadataSynchronization(doc, metadata);