XmpPacketWrapper Class
Contains serialized XMP package including header and trailer. A wrapper consisting of a pair of XML processing instructions (PIs) may be placed around the rdf:RDF element.
Inheritance Hierarchy
SystemObject
  GroupDocs.Metadata.CommonMetadataPackage
    GroupDocs.Metadata.Standards.XmpXmpPacketWrapper

Namespace: GroupDocs.Metadata.Standards.Xmp
Assembly: GroupDocs.Metadata (in GroupDocs.Metadata.dll) Version: 21.6
Syntax
public class XmpPacketWrapper : MetadataPackage, 
	IXmpType

The XmpPacketWrapper type exposes the following members.

Constructors
  NameDescription
Public methodXmpPacketWrapper
Initializes a new instance of the XmpPacketWrapper class.
Public methodXmpPacketWrapper(XmpHeaderPI, XmpTrailerPI, XmpMeta)
Initializes a new instance of the XmpPacketWrapper class.
Properties
  NameDescription
Public propertyCount
Gets the number of metadata properties.
(Inherited from MetadataPackage.)
Public propertyHeaderPI
Gets or sets the header processing instruction.
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 propertyMeta
Gets or sets the XMP meta.
Public propertyMetadataType
Gets the metadata type.
(Inherited from MetadataPackage.)
Public propertyPackageCount
Gets the number of packages inside the XMP structure.
Public propertyPackages
Gets array of XmpPackage inside XMP.
Public propertyPropertyDescriptors
Gets a collection of descriptors that contain information about properties accessible through the GroupDocs.Metadata search engine.
(Inherited from MetadataPackage.)
Public propertySchemes
Provides access to known XMP schemas.
Public propertyTrailerPI
Gets or sets the trailer processing instruction.
Methods
  NameDescription
Public methodCode exampleAddPackage
Adds the package.
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 methodClearPackages
Removes all XmpPackage inside XMP.
Public methodContains
Determines whether the package contains a metadata property with the specified name.
(Inherited from MetadataPackage.)
Public methodContainsPackage
Determines whether package is exist in XMP wrapper.
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 methodGetPackage
Gets package by namespace uri.
Public methodGetType (Inherited from Object.)
Public methodGetXmpRepresentation
Returns string contained value in XMP format.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRemovePackage
Removes the specified package.
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 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 shows how to update XMP metadata properties.
C#
using (Metadata metadata = new Metadata(Constants.GifWithXmp))
{
    IXmp root = metadata.GetRootPackage() as IXmp;
    if (root != null && root.XmpPackage != null)
    {
        // if there is no such scheme in the XMP package we should create it
        if (root.XmpPackage.Schemes.DublinCore == null)
        {
            root.XmpPackage.Schemes.DublinCore = new XmpDublinCorePackage();
        }
        root.XmpPackage.Schemes.DublinCore.Format = "image/gif";
        root.XmpPackage.Schemes.DublinCore.SetRights("Copyright (C) 2011-2021 GroupDocs. All Rights Reserved");
        root.XmpPackage.Schemes.DublinCore.SetSubject("test");

        if (root.XmpPackage.Schemes.CameraRaw == null)
        {
            root.XmpPackage.Schemes.CameraRaw = new XmpCameraRawPackage();
        }
        root.XmpPackage.Schemes.CameraRaw.Shadows = 50;
        root.XmpPackage.Schemes.CameraRaw.AutoBrightness = true;
        root.XmpPackage.Schemes.CameraRaw.AutoExposure = true;
        root.XmpPackage.Schemes.CameraRaw.CameraProfile = "test";
        root.XmpPackage.Schemes.CameraRaw.Exposure = 0.0001;

        // If you don't want to keep the old values just replace the whole scheme
        root.XmpPackage.Schemes.XmpBasic = new XmpBasicPackage();
        root.XmpPackage.Schemes.XmpBasic.CreateDate = DateTime.Today;
        root.XmpPackage.Schemes.XmpBasic.BaseUrl = "https://groupdocs.com";
        root.XmpPackage.Schemes.XmpBasic.Rating = 5;

        root.XmpPackage.Schemes.BasicJobTicket = new XmpBasicJobTicketPackage();

        // Set a complex type property
        root.XmpPackage.Schemes.BasicJobTicket.Jobs = new[]
        {
            new XmpJob
            {
                ID = "1",
                Name = "test job",
                Url = "https://groupdocs.com"
            },
        };

        // ... 

        metadata.Save(Constants.OutputGif);
    }
}
See Also