Chilkat Examples

ChilkatHOMEAndroid™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi DLLGoJavaNode.jsObjective-CPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwiftTclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Xojo Plugin Examples
Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Apple Keychain
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Box
CAdES
CSR
CSV
Cert Store
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
X
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(Xojo Plugin) Extract Metadata XML from PDF

See more PDF Signatures Examples
Demonstrates how to extract the metadata XML from a PDF.

Chilkat Xojo Plugin Download

Xojo Plugin for Windows, Linux, Mac OS X, and ARM, ARM64

// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

Dim pdf As New Chilkat.Pdf

Dim success As Boolean
success = pdf.LoadFile("qa_data/pdf/blank_with_metadata.pdf")
If (success = False) Then
    System.DebugLog(pdf.LastErrorText)
    Return
End If

Dim sbXml As New Chilkat.StringBuilder
// Note: Not all PDF files have metadata.  Metadata is optional.
success = pdf.GetMetadata(sbXml)
If (success = False) Then
    System.DebugLog(pdf.LastErrorText)
    Return
End If

Dim xml As New Chilkat.Xml
success = xml.LoadSb(sbXml,True)

System.DebugLog(xml.GetXml())

// Sample PDF metadata XML:
// (Code for parsing follows)

// Use this online tool to generate parsing code from sample XML: 
// Generate Parsing Code from XML

// <?xml version="1.0" encoding="utf-8"?>
// <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 9.1-c001 79.675d0f7, 2023/06/11-19:21:16        ">
//     <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/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/">
//             <xmp:ModifyDate>2024-11-27T11:33:12-06:00</xmp:ModifyDate>
//             <xmp:CreateDate>2024-11-27T11:28:23-06:00</xmp:CreateDate>
//             <xmp:MetadataDate>2024-11-27T11:33:12-06:00</xmp:MetadataDate>
//             <xmp:CreatorTool>Adobe Acrobat Pro (32-bit) 24.3.20112</xmp:CreatorTool>
//             <dc:format>application/pdf</dc:format>
//             <dc:title>
//                 <rdf:Alt>
//                     <rdf:li xml:lang="x-default">Blank</rdf:li>
//                 </rdf:Alt>
//             </dc:title>
//             <dc:creator>
//                 <rdf:Bag>
//                     <rdf:li>Chilkat Software</rdf:li>
//                 </rdf:Bag>
//             </dc:creator>
//             <dc:description>
//                 <rdf:Alt>
//                     <rdf:li xml:lang="x-default">Blank Document</rdf:li>
//                 </rdf:Alt>
//             </dc:description>
//             <dc:subject>
//                 <rdf:Bag>
//                     <rdf:li>blank</rdf:li>
//                     <rdf:li>metadata</rdf:li>
//                     <rdf:li>document</rdf:li>
//                 </rdf:Bag>
//             </dc:subject>
//             <xmpMM:DocumentID>uuid:34535ffa-b632-43f1-b1fd-80cea6fdc351</xmpMM:DocumentID>
//             <xmpMM:InstanceID>uuid:69ace620-4c54-407f-8d45-6eebc90f34c2</xmpMM:InstanceID>
//             <pdf:Producer>Adobe Acrobat Pro (32-bit) 24.3.20112</pdf:Producer>
//             <pdf:Keywords>blank; metadata; document</pdf:Keywords>
//             <xmpRights:WebStatement>https://www.chilkatsoft.com/</xmpRights:WebStatement>
//         </rdf:Description>
//     </rdf:RDF>
// </x:xmpmeta>

Dim x_xmpmeta_xmlns_x As String
x_xmpmeta_xmlns_x = xml.GetAttrValue("xmlns:x")
Dim x_xmpmeta_x_xmptk As String
x_xmpmeta_x_xmptk = xml.GetAttrValue("x:xmptk")
Dim rdf_RDF_xmlns_rdf As String
rdf_RDF_xmlns_rdf = xml.ChilkatPath("rdf:RDF|(xmlns:rdf)")
Dim rdf_Description_rdf_about As String
rdf_Description_rdf_about = xml.ChilkatPath("rdf:RDF|rdf:Description|(rdf:about)")
Dim rdf_Description_xmlns_xmp As String
rdf_Description_xmlns_xmp = xml.ChilkatPath("rdf:RDF|rdf:Description|(xmlns:xmp)")
Dim rdf_Description_xmlns_dc As String
rdf_Description_xmlns_dc = xml.ChilkatPath("rdf:RDF|rdf:Description|(xmlns:dc)")
Dim rdf_Description_xmlns_xmpMM As String
rdf_Description_xmlns_xmpMM = xml.ChilkatPath("rdf:RDF|rdf:Description|(xmlns:xmpMM)")
Dim rdf_Description_xmlns_pdf As String
rdf_Description_xmlns_pdf = xml.ChilkatPath("rdf:RDF|rdf:Description|(xmlns:pdf)")
Dim rdf_Description_xmlns_xmpRights As String
rdf_Description_xmlns_xmpRights = xml.ChilkatPath("rdf:RDF|rdf:Description|(xmlns:xmpRights)")
Dim xmp_ModifyDate As String
xmp_ModifyDate = xml.GetChildContent("rdf:RDF|rdf:Description|xmp:ModifyDate")
Dim xmp_CreateDate As String
xmp_CreateDate = xml.GetChildContent("rdf:RDF|rdf:Description|xmp:CreateDate")
Dim xmp_MetadataDate As String
xmp_MetadataDate = xml.GetChildContent("rdf:RDF|rdf:Description|xmp:MetadataDate")
Dim xmp_CreatorTool As String
xmp_CreatorTool = xml.GetChildContent("rdf:RDF|rdf:Description|xmp:CreatorTool")
Dim dc_format As String
dc_format = xml.GetChildContent("rdf:RDF|rdf:Description|dc:format")
Dim rdf_li_xml_lang As String
rdf_li_xml_lang = xml.ChilkatPath("rdf:RDF|rdf:Description|dc:title|rdf:Alt|rdf:li|(xml:lang)")
Dim rdf_li As String
rdf_li = xml.GetChildContent("rdf:RDF|rdf:Description|dc:title|rdf:Alt|rdf:li")
rdf_li = xml.GetChildContent("rdf:RDF|rdf:Description|dc:creator|rdf:Bag|rdf:li")
rdf_li_xml_lang = xml.ChilkatPath("rdf:RDF|rdf:Description|dc:description|rdf:Alt|rdf:li|(xml:lang)")
rdf_li = xml.GetChildContent("rdf:RDF|rdf:Description|dc:description|rdf:Alt|rdf:li")
Dim i As Int32
i = 0
Dim count_i As Int32
count_i = xml.NumChildrenHavingTag("rdf:RDF|rdf:Description|dc:subject|rdf:Bag|rdf:li")
While i < count_i
    xml.I = i
    rdf_li = xml.GetChildContent("rdf:RDF|rdf:Description|dc:subject|rdf:Bag|rdf:li[i]")
    i = i + 1
Wend
Dim xmpMM_DocumentID As String
xmpMM_DocumentID = xml.GetChildContent("rdf:RDF|rdf:Description|xmpMM:DocumentID")
Dim xmpMM_InstanceID As String
xmpMM_InstanceID = xml.GetChildContent("rdf:RDF|rdf:Description|xmpMM:InstanceID")
Dim pdf_Producer As String
pdf_Producer = xml.GetChildContent("rdf:RDF|rdf:Description|pdf:Producer")
Dim pdf_Keywords As String
pdf_Keywords = xml.GetChildContent("rdf:RDF|rdf:Description|pdf:Keywords")
Dim xmpRights_WebStatement As String
xmpRights_WebStatement = xml.GetChildContent("rdf:RDF|rdf:Description|xmpRights:WebStatement")

 

© 2000-2025 Chilkat Software, Inc. All Rights Reserved.