Back to Devexpress

XmpDocument.XmpProperties Property

officefileapi-devexpress-dot-pdf-dot-xmp-dot-xmpdocument-ef01cb17.md

latest3.9 KB
Original Source

XmpDocument.XmpProperties Property

Gets properties used to define the XMP basic namespace.

Namespace : DevExpress.Pdf.Xmp

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

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public XmpProperties XmpProperties { get; }
vb
Public ReadOnly Property XmpProperties As XmpProperties

Property Value

TypeDescription
XmpProperties

An object that contains XMP basic namespace properties.

|

Example

The code sample below adds items from the basic schema to the packet:

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

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

    // Create a new XMP packet:
    XmpDocument metadata = new XmpDocument();

    XmpProperties basicSchema = metadata.XmpProperties;
    basicSchema.CreatorTool = "PDF Document API";
    basicSchema.Label = "Sample";
    basicSchema.Identifier.Add("Id");
    basicSchema.Rating = "0";

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

    // Save the result:
    pdfDocumentProcessor.SaveDocument("Invoice_Upd.pdf");
}
vb
Imports DevExpress.Pdf
Imports DevExpress.Pdf.Xmp
'...

Using pdfDocumentProcessor As New PdfDocumentProcessor()
    ' Load a document:
    pdfDocumentProcessor.LoadDocument("Documents//Invoice.pdf")
    Dim document As PdfDocument = pdfDocumentProcessor.Document

    ' Create a new XMP packet:
    Dim metadata As New XmpDocument()

      Dim basicSchema As XmpProperties = metadata.XmpProperties
      basicSchema.CreatorTool = "PDF Document API"
      basicSchema.Label = "Sample"
      basicSchema.Identifier.Add("Id")
      basicSchema.Rating = "0"

    ' Embed metadata in the document:
    document.SetMetadata(metadata)

    ' Save the result:
    pdfDocumentProcessor.SaveDocument("Invoice_Upd.pdf")
End Using

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the XmpProperties property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

pdf-document-api-xmp-example/CS/XmpMetadataExamples/Program.cs#L130

csharp
// Add items from the XMP basic schema:
XmpProperties basicSchema = metadata.XmpProperties;
basicSchema.CreatorTool = "PDF Document API";

pdf-document-api-xmp-example/VB/XmpMetadataExamples/Program.vb#L104

vb
' Add items from the XMP basic schema:
Dim basicSchema As XmpProperties = metadata.XmpProperties
basicSchema.CreatorTool = "PDF Document API"

See Also

XmpDocument Class

XmpDocument Members

DevExpress.Pdf.Xmp Namespace