Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.GetInMetadata

Queries input PDF metadata.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 5.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.GetInMetadata"; PDF; ObjType { ; PageNum } )   More

Parameters

Parameter Description Example Flags
PDF The PDF reference returned from DynaPDF.New. $pdf
ObjType The object type. Can be Catalog, Font, Image, Page or Template. "Catalog"
PageNum Page number or -1 to access the global XMP stream. -1 Optional

Result

Returns text or error.

Description

Queries input PDF metadata.
The function can be used to access the optional metadata streams of pages or the global metadata stream of the current open import file. Metadata streams are in XMP format that is a superset of XML. The PDF file must be opened with DynaPDF.OpenPDFFromFile or DynaPDF.OpenPDFFromContainer beforehand.
Although the global XMP stream does usually exist in todays PDF files, metadata streams are optional and maybe not present. The function empty text, if no metadata stream is present.

See also GetInMetadata function in DynaPDF manual.

Examples

Open PDF and get XMP metadata:

Set Variable [$pdf; Value:MBS("DynaPDF.New")]
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; DynaPDF XMP::InputPDF)]
Set Field [DynaPDF XMP::XMP; MBS( "DynaPDF.GetInMetadata"; $pdf; "Catalog"; -1 )]
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]

Read metadata of a ZUGFeRD invoice:

Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; ZUGFerDLesen::PDF) ]
Set Variable [ $r ; Value: MBS("DynaPDF.GetInMetadata"; $pdf; "Catalog") ]
Set Field [ ZUGFerDLesen::metadata ; $r ]

Example result:
<?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:pdfaid="http://www.aiim.org/pdfa/ns/id/">
      <pdfaid:part>3</pdfaid:part>
      <pdfaid:conformance>B</pdfaid:conformance>
    </rdf:Description>
    <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
      <dc:title>
        <rdf:Alt>
            <rdf:li xml:lang="x-default">MUSTERLIEFERANT GMBH: Invoice RK21012345</rdf:li>
        </rdf:Alt>
      </dc:title>
      <dc:creator>
        <rdf:Seq>
            <rdf:li>MUSTERLIEFERANT GMBH</rdf:li>
        </rdf:Seq>
      </dc:creator>
      <dc:description>
        <rdf:Alt>
            <rdf:li xml:lang="x-default">Invoice RK21012345 dated 2024-11-15 issued by MUSTERLIEFERANT GMBH</rdf:li>
        </rdf:Alt>
      </dc:description>
    </rdf:Description>
    <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
      <pdf:Producer>pypdf</pdf:Producer>
    </rdf:Description>
    <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
      <xmp:CreatorTool>factur-x Python lib v1.1 by DWC and Alexis de Lattre</xmp:CreatorTool>
      <xmp:CreateDate>2024-11-11T14:19:04+00:00</xmp:CreateDate>
      <xmp:ModifyDate>2024-11-11T14:19:04+00:00</xmp:ModifyDate>
    </rdf:Description>
    <rdf:Description 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#" rdf:about="">
      <pdfaExtension:schemas>
        <rdf:Bag>
            <rdf:li rdf:parseType="Resource">
              <pdfaSchema:schema>Factur-X PDFA Extension Schema</pdfaSchema:schema>
              <pdfaSchema:namespaceURI>urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#</pdfaSchema:namespaceURI>
              <pdfaSchema:prefix>fx</pdfaSchema:prefix>
              <pdfaSchema:property>
                <rdf:Seq>
                    <rdf:li rdf:parseType="Resource">
                      <pdfaProperty:name>DocumentFileName</pdfaProperty:name>
                      <pdfaProperty:valueType>Text</pdfaProperty:valueType>
                      <pdfaProperty:category>external</pdfaProperty:category>
                      <pdfaProperty:description>The name of the embedded XML document</pdfaProperty:description>
                    </rdf:li>
                    <rdf:li rdf:parseType="Resource">
                      <pdfaProperty:name>DocumentType</pdfaProperty:name>
                      <pdfaProperty:valueType>Text</pdfaProperty:valueType>
                      <pdfaProperty:category>external</pdfaProperty:category>
                      <pdfaProperty:description>The type of the hybrid document in capital letters, e.g. INVOICE or ORDER</pdfaProperty:description>
                    </rdf:li>
                    <rdf:li rdf:parseType="Resource">
                      <pdfaProperty:name>Version</pdfaProperty:name>
                      <pdfaProperty:valueType>Text</pdfaProperty:valueType>
                      <pdfaProperty:category>external</pdfaProperty:category>
                      <pdfaProperty:description>The actual version of the standard applying to the embedded XML document</pdfaProperty:description>
                    </rdf:li>
                    <rdf:li rdf:parseType="Resource">
                      <pdfaProperty:name>ConformanceLevel</pdfaProperty:name>
                      <pdfaProperty:valueType>Text</pdfaProperty:valueType>
                      <pdfaProperty:category>external</pdfaProperty:category>
                      <pdfaProperty:description>The conformance level of the embedded XML document</pdfaProperty:description>
                    </rdf:li>
                </rdf:Seq>
              </pdfaSchema:property>
            </rdf:li>
        </rdf:Bag>
      </pdfaExtension:schemas>
    </rdf:Description>
    <rdf:Description xmlns:fx="urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#" rdf:about="">
      <fx:DocumentType>INVOICE</fx:DocumentType>
      <fx:DocumentFileName>factur-x.xml</fx:DocumentFileName>
      <fx:Version>1.0</fx:Version>
      <fx:ConformanceLevel>EN 16931</fx:ConformanceLevel>
    </rdf:Description>
  </rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>

See also

Blog Entries

This function checks for a license.

Created 29th July 2015, last changed 28th February 2025


DynaPDF.GetInIsXFAForm - DynaPDF.GetInPDFVersionEx