Overview

The GroupDocs.Metadata for .NET 25.5 release brings a host of new features, improvements, and bug fixes to enhance your document metadata management experience. This release focuses on providing better support for SVG files, including the ability to update and clean XMP packages. Whether you are a developer looking to integrate metadata management into your applications or a user seeking to manage document metadata efficiently, this release has something for you.

Table of contents

How to Clean XMP Package in SVG Files

In this section, we will demonstrate how to clean the XMP package from an SVG file using GroupDocs.Metadata for .NET. This can be useful when you need to remove metadata from SVG files to ensure compliance with privacy policies or to reduce file size.

Steps to Clean XMP Package in SVG Files

  1. Load the SVG file using the Metadata class.
  2. Retrieve the root package of the SVG file.
  3. Set the XMP package to null.
  4. Save the modified SVG file.

Code Example

// Clean XMP package
using (Metadata metadata = new Metadata("input.svg"))
{
    // Retrieve the root package of the SVG file
    var format = metadata.GetRootPackage<SvgRootPackage>();

    // Set the XMP package to null to clean it
    format.XmpPackage = null;

    // Save the modified SVG file
    metadata.Save();
}

How to Update XMP Properties in SVG Files

In this section, we will show you how to update the XMP properties of an SVG file using GroupDocs.Metadata for .NET. This can be useful when you need to add or modify metadata properties in SVG files for better document management. For example when you want to edit XMP basic label field.

Steps to Update XMP Properties in SVG Files

  1. Load the SVG file using the Metadata class.
  2. Retrieve the root package of the SVG file.
  3. Create a new XmpPacketWrapper object.
  4. Set the desired XMP properties.
  5. Assign the XmpPacketWrapper to the root package.
  6. Save the modified SVG file.

Code Example

// How to update XMP properties of a SVG file.
using (Metadata metadata = new Metadata("input.svg"))
{
    // Retrieve the root package of the SVG file
    var root = metadata.GetRootPackage<SvgRootPackage>();

    // Print the XmpBasic Label before updating
    Console.WriteLine("XmpBasic Label before: {0}", "");

    // Create a new XmpPacketWrapper object
    var xmpPacketWrapper = new XmpPacketWrapper();

    // Create a new XmpBasicPackage object and set the Label property
    xmpPacketWrapper.Schemes.XmpBasic = new XmpBasicPackage();
    xmpPacketWrapper.Schemes.XmpBasic.Label = "Architecture collection";

    // Assign the XmpPacketWrapper to the root package
    root.XmpPackage = xmpPacketWrapper;

    // Save the modified SVG file
    metadata.Save();
}

Getting Started with a Free Trial

By default, the library operates in trial mode without a license, allowing you to explore its basic features and functionalities. You can download GroupDocs.Metadata for Python via .NET from the GroupDocs Releases page.

Additionally, you can acquire a temporary license from this link. The temp license allows you to use the library without any restrictions and fully explore its capabilities.

See also

For more information, you can refer to the following resources:

Try GroupDocs.Metadata for .NET for Free

You can download a free trial from releases.groupdocs.com and also acquire a temporary license on purchase.groupdocs.com/temporary-license/. The temporary license allows you to try our library without restrictions.