XmpMetaData manipulation

Hi,

Here an extract of my PDF’s XMP :

    <?xpacket begin="�" id="W5M0MpCehiHzreSzNTczkc9d"?>
    <x:xmpmeta xmlns:x="adobe:ns:meta/">
     <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
       <xmp:CreateDate>2020-06-02T09:20:14Z</xmp:CreateDate>
       <xmp:ModifyDate>2020-06-02T09:20:14Z</xmp:ModifyDate>
       <xmp:CreatorTool>Aspose Ltd.</xmp:CreatorTool>
      </rdf:Description>
      <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
       <dc:description>
        <rdf:Alt>
         <rdf:li xml:lang="x-default">C</rdf:li>
        </rdf:Alt>
       </dc:description>
       <dc:title>
        <rdf:Alt>
         <rdf:li xml:lang="x-default">FactureClient</rdf:li>
        </rdf:Alt>
       </dc:title>
       <dc:creator>
        <rdf:Seq>
         <rdf:li xml:lang="x-default">LEntreprise</rdf:li>
        </rdf:Seq>
       </dc:creator>
      </rdf:Description>
      <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
       <pdf:Producer>Aspose.PDF for .NET 20.5</pdf:Producer>
       <pdf:Keywords>...</pdf:Keywords>
      </rdf:Description>
      <rdf:Description rdf:about="" xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/">
       <pdfaid:part>3</pdfaid:part>
       <pdfaid:conformance>A</pdfaid:conformance>
      </rdf:Description>
      <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" />
      <rdf:Description rdf:about="" xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" />
      <rdf:Description rdf:about="" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" />
      <rdf:Description rdf:about="" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" />
      <rdf:Description rdf:about="" xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaType="http://www.aiim.org/pdfa/ns/type#" xmlns:pdfaField="http://www.aiim.org/pdfa/ns/field#">

As you can see I have many line like this:
<rdf:Description rdf:about="" xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" ...

I would like to remove some of them to clean the file but I can’t find how. Could you give me some advice please to help me on this subject ?

I know how remove a “child” like < pdf:Keywords > with this code I imagine :

    var xmpMetaData = new PdfXmpMetadata();
    xmpMetaData.BindPdf(pdfDocument);
    xmpMetaData.Remove("pdf:Keywords");

But How remove his parent entirely for example and not only his child Producer and Keywords ?

    **<rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">**
            `<pdf:Producer>Aspose.PDF for .NET 20.5</pdf:Producer>`
            `<pdf:Keywords>...</pdf:Keywords>`
      **</rdf:Description>**

And other question, is it possible to recover the entire content of the XMP data to copy to another document ?

Example :

pdfDocument.Metadata = pdfDocumentTemp.Metadata;

Thank’s for your supply

@Murphy54

You cannot remove or change any of these properties in the PDF document as according to company policy, Aspose.PDF for XXX or Aspose Pty Ltd will be shown against Producer/Generator or similar fields.

You can get MetaData from a PDF document and set it for another PDF accordingly using the API. In case you face any issue, please share your sample PDF with us. We will test the scenario in our environment and address it accordingly.

Thank’s for your reply.

Have a nice day