Sets known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well. This method is a combination of AddProperties and UpdateProperties. If an existing property satisfies the predicate its value is updated. If there is a known property missing in the package that satisfies the predicate it is added to the package.
This code sample shows hot to update basic IPTC metadata properties.
using(Metadatametadata=newMetadata(Constants.InputJpeg)){IIptcroot=metadata.GetRootPackage()asIIptc;if(root!=null){// Set the IPTC package if it's missingif(root.IptcPackage==null){root.IptcPackage=newIptcRecordSet();}if(root.IptcPackage.EnvelopeRecord==null){root.IptcPackage.EnvelopeRecord=newIptcEnvelopeRecord();}root.IptcPackage.EnvelopeRecord.DateSent=DateTime.Now;root.IptcPackage.EnvelopeRecord.ProductID=Guid.NewGuid().ToString();// ...if(root.IptcPackage.ApplicationRecord==null){root.IptcPackage.ApplicationRecord=newIptcApplicationRecord();}root.IptcPackage.ApplicationRecord.ByLine="GroupDocs";root.IptcPackage.ApplicationRecord.Headline="test";root.IptcPackage.ApplicationRecord.ByLineTitle="code sample";root.IptcPackage.ApplicationRecord.ReleaseDate=DateTime.Today;// ...metadata.Save(Constants.OutputJpeg);}}