Back to Devexpress

XmpRightsManagementProperties Class

officefileapi-devexpress-dot-pdf-dot-xmp-4c8c45e4.md

latest3.5 KB
Original Source

XmpRightsManagementProperties Class

Contains properties used to define the XMP Rights Management namespace.

Namespace : DevExpress.Pdf.Xmp

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

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public class XmpRightsManagementProperties
vb
Public Class XmpRightsManagementProperties

The following members return XmpRightsManagementProperties objects:

Remarks

The XMP Rights Management namespace contains information regarding the legal restrictions associated with a PDF document. The namespace URI is http://ns.adobe.com/xap/1.0/rights/, the prefix is xmpRights.

Example

The code sample below adds items from the Rights Management 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();
    XmpRightsManagementProperties rightsManagementSchema =
        metadata.RightsManagementProperties;
    rightsManagementSchema.Certificate = "https://www.devexpress.com/";
    rightsManagementSchema.Owner.Add("DevExpress");
    rightsManagementSchema.Marked = true;
    rightsManagementSchema.WebStatement = "https://www.devexpress.com/support/eulas/";
    rightsManagementSchema.UsageTerms.AddString("Copyright(C) 2021 DevExpress.All Rights Reserved.", 
        "x-default");

    // 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 rightsManagementSchema As XmpRightsManagementProperties = 
        metadata.RightsManagementProperties
    rightsManagementSchema.Certificate = "https://www.devexpress.com/"
    rightsManagementSchema.Owner.Add("DevExpress")
    rightsManagementSchema.Marked = True
    rightsManagementSchema.WebStatement = "https://www.devexpress.com/support/eulas/"
    rightsManagementSchema.UsageTerms.AddString("Copyright(C) 2021 DevExpress.All Rights Reserved.",
         "x-default")

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

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

Inheritance

Object XmpRightsManagementProperties

See Also

XmpRightsManagementProperties Member

DevExpress.Pdf.Xmp Namespace