XmpPacketWrapperAddPackage Method
Adds the package.

Namespace: GroupDocs.Metadata.Standards.Xmp
Assembly: GroupDocs.Metadata (in GroupDocs.Metadata.dll) Version: 21.6
Syntax
public void AddPackage(
	XmpPackage package
)

Parameters

package
Type: GroupDocs.Metadata.Standards.XmpXmpPackage
The package.
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