How To Add XMP Metadata Which Produces Attributes Instead Of Elements Under <rdf:Description>

Using the sample code from here (Working with PDF File Metadata | C#|Aspose.PDF for .NET) produces the following XML:

<rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
   <xmp:CreatorTool>Microsoft® Word for Microsoft 365</xmp:CreatorTool>
   <xmp:ModifyDate>2022-09-12T02:23:42.6+03:00</xmp:ModifyDate>
   <xmp:CreateDate>2022-09-12T02:23:42.6+03:00</xmp:CreateDate>
   <xmp:Nickname>Nickname</xmp:Nickname>
   <xmp:CustomProperty>Custom Value</xmp:CustomProperty>
  </rdf:Description>

Looking at old samples using other XMP Toolkit or other tools I see that instead of elements the single values are serialized as attributes:

<rdf:Description rdf:about=""
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:pdf="http://ns.adobe.com/pdf/1.3/"
    xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"

   xmp:CreateDate="2013-06-11T10:27:50-04:00"
   xmp:CreatorTool="Adobe Graphics Manager"
   xmp:ModifyDate="2013-09-11T16:49:11-04:00"
  
   pdf:Producer="Acrobat Distiller 9.5.3 (Macintosh)"
   xmpMM:DocumentID="uuid:ff8aaf38-fcb3-da41-8772-366fcee062bf"
   xmpMM:InstanceID="uuid:ee4d40a2-8257-1d42-accf-84f42acfea85">

How can I achieve this with Aspose.PDF Library - thanks.

@nikolayyordanov

We need to perform investigation for your requirement. Therefore, a ticket as PDFNET-52535 has been logged in our issue tracking system for the sake of further analysis. We will look into its details and let you know as soon as it is resolved. Please be patient and spare us some time.

1 Like

Hello @asad.ali - any estimation on when to expect results from the investigation. What I have found in the XMP specification document is that this is called “RDF Shorthand notation” when “simple properties are represented as XML attributes instead of XML elements”.

@nikolayyordanov

The ticket has just been logged in our issue tracking system and it is pending for analysis. We will investigate and resolve it on a first come first serve basis and let you know once we make some progress towards its resolution. Please spare us some time.