2

How can I read XMP from an existing PDF file using iTextSharp?

knut
  • 4,699
  • 4
  • 33
  • 43

2 Answers2

4

I'm dangerously ignorant of itextSharp but this did the job for me:

    PdfReader pdf = new PdfReader(fileName);
    string metadataXml = System.Text.Encoding.Default.GetString(pdf.Metadata);
AndrewFreese
  • 111
  • 2
  • 7
1

I'd encourage you to check out the iTextSharp.text.xml.xmp namespace.

I've never done what you're trying to do but the XmpReader class looks promising.

Jay Riggs
  • 53,046
  • 9
  • 139
  • 151