Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XmpName Class

The XMP packet node name in the prefix:local format.

Namespace: DevExpress.Pdf.Xmp

Assembly: DevExpress.Pdf.v24.2.Core.dll

NuGet Package: DevExpress.Pdf.Core

#Declaration

public class XmpName :
    IEquatable<XmpName>

The following members return XmpName objects:

#Remarks

When you add a new node to the packet, use the XmpName object to specify the node name. Call the XmpName.Get(String, String) method to generate a node name and register the prefix.

The code sample below sues the XmpName.Get(String, String) method to generate a name for a new structure node:

using DevExpress.Pdf;
using DevExpress.Pdf.Xmp;
//...

using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
    // Load a document
    pdfDocumentProcessor.LoadDocument("Documents//Invoice.pdf");
    PdfDocument document = pdfDocumentProcessor.Document;

    // Retrieve metadata:
    XmpDocument metadata = XmpDocument.FromString(document.Metadata.Data);

    // Add MaxPageSize structure:
    XmpName structureName = XmpName.Get("MaxPageSize", "http://ns.adobe.com/xap/1.0/t/pg/");
    XmpStructure dimensions = metadata.CreateStructure(structureName);
    metadata.RegisterNamespace("http://ns.adobe.com/xap/1.0/sType/Dimensions#", "stDim");
    dimensions.Add("stDim:h", 11);
    dimensions.Add("stDim:w", 8.5f);
    dimensions.Add("stDim:Unit", "inch");

    // Embed modified metadata in the document:
    document.SetMetadata(metadata);

    // Save the result:
    pdfDocumentProcessor.SaveDocument("Invoice_Upd.pdf");
}

#Implements

#Inheritance

Object
XmpName
See Also