AddPackage
XmpPacketWrapper.AddPackage method
Menambahkan paket.
public void AddPackage(XmpPackage package)
Parameter | Jenis | Keterangan |
---|---|---|
package | XmpPackage | Paket. |
Contoh
Contoh ini menunjukkan cara menambahkan paket XMP khusus ke file dengan format apa pun yang didukung.
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-2022 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);
}
}
Lihat juga
- class XmpPackage
- class XmpPacketWrapper
- ruang nama GroupDocs.Metadata.Standards.Xmp
- perakitan GroupDocs.Metadata