XmpPackage Class
Represents base abstraction for XMP package.
Inheritance Hierarchy
SystemObject
  GroupDocs.Metadata.CommonMetadataPackage
    GroupDocs.Metadata.CommonCustomPackage
      GroupDocs.Metadata.Standards.XmpXmpMetadataContainer
        GroupDocs.Metadata.Standards.XmpXmpPackage
          More...

Namespace: GroupDocs.Metadata.Standards.Xmp
Assembly: GroupDocs.Metadata (in GroupDocs.Metadata.dll) Version: 21.6
Syntax
public class XmpPackage : XmpMetadataContainer

The XmpPackage type exposes the following members.

Constructors
  NameDescription
Public methodXmpPackage
Initializes a new instance of the XmpPackage class.
Properties
  NameDescription
Public propertyCount
Gets the number of metadata properties.
(Inherited from MetadataPackage.)
Public propertyItem
Gets the MetadataProperty with the specified name.
(Inherited from MetadataPackage.)
Public propertyKeys
Gets a collection of the metadata property names.
(Inherited from MetadataPackage.)
Public propertyKnowPropertyDescriptors Obsolete.
Gets a collection of descriptors that contain information about properties accessible through the GroupDocs.Metadata search engine.
(Inherited from MetadataPackage.)
Public propertyMetadataType
Gets the metadata type.
(Inherited from MetadataPackage.)
Public propertyNamespaceUri
Gets the namespace URI.
Public propertyPrefix
Gets the xmlns prefix.
Public propertyPropertyDescriptors
Gets a collection of descriptors that contain information about properties accessible through the GroupDocs.Metadata search engine.
(Inherited from MetadataPackage.)
Public propertyXmlNamespace
Gets the XML namespace.
Methods
  NameDescription
Public methodAddProperties
Adds known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well.
(Inherited from MetadataPackage.)
Public methodClear
Removes all XMP properties.
Public methodContains
Determines whether the package contains a metadata property with the specified name.
(Inherited from MetadataPackage.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFindProperties
Finds the metadata properties satisfying the specified predicate. The search is recursive so it affects all nested packages as well.
(Inherited from MetadataPackage.)
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
(Inherited from MetadataPackage.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodGetXmpRepresentation
Converts the XMP value to the XML representation.
(Overrides XmpMetadataContainerGetXmpRepresentation.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRemove
Removes the property with the specified name.
Public methodRemoveProperties
Removes metadata properties satisfying the specified predicate.
(Inherited from MetadataPackage.)
Public methodSanitize
Removes writable metadata properties from the package. The operation is recursive so it affects all nested packages as well.
(Inherited from MetadataPackage.)
Public methodSet(String, XmpArray)
Sets the value inherited from XmpArray .
Public methodSet(String, XmpComplexType)
Sets the value inherited from XmpComplexType .
Public methodSet(String, XmpValueBase)
Sets the value inherited from XmpValueBase .
Public methodSet(String, Boolean)
Sets boolean property.
Public methodSet(String, DateTime)
Sets DateTime property.
Public methodSet(String, Double)
Sets double property.
Public methodSet(String, Int32)
Sets integer property.
Public methodSet(String, String)
Sets string property.
Public methodSetProperties
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(FuncMetadataProperty, Boolean, PropertyValue) and UpdateProperties(FuncMetadataProperty, Boolean, PropertyValue). 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.
(Inherited from MetadataPackage.)
Public methodToString (Inherited from Object.)
Public methodUpdateProperties
Updates known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well.
(Inherited from MetadataPackage.)
Remarks
Examples
This example demonstrates how to add a custom XMP package to a file of any supported format.
C#
using (Metadata metadata = new Metadata(Constants.InputJpeg))
{
    IXmp root = metadata.GetRootPackage() as IXmp;
    if (root != null)
    {
        var packet = new XmpPacketWrapper();

        var custom = new XmpPackage("gd", "https://groupdocs.com");
        custom.Set("gd:Copyright", "Copyright (C) 2011-2021 GroupDocs. All Rights Reserved.");
        custom.Set("gd:CreationDate", DateTime.Today);
        custom.Set("gd:Company", XmpArray.From(new [] { "Aspose", "GroupDocs" }, XmpArrayType.Ordered));

        packet.AddPackage(custom);
        root.XmpPackage = packet;

        metadata.Save(Constants.OutputJpeg);
    }
}
See Also
Inheritance Hierarchy
SystemObject
  GroupDocs.Metadata.CommonMetadataPackage
    GroupDocs.Metadata.CommonCustomPackage
      GroupDocs.Metadata.Standards.XmpXmpMetadataContainer
        GroupDocs.Metadata.Standards.XmpXmpPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpBasicJobTicketPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpBasicPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpCameraRawPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpDublinCorePackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpDynamicMediaPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpIptcCorePackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpIptcExtensionPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpIptcIimPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpMediaManagementPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpPagedTextPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpPdfPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpPhotoshopPackage
          GroupDocs.Metadata.Standards.Xmp.SchemesXmpRightsManagementPackage