How can I read XMP from an existing PDF file using iTextSharp?
Asked
Active
Viewed 2,331 times
2 Answers
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
-
Info: `iTextSharp.text.xml.xmp.XmlReader` is obsolete. – ˈvɔlə Apr 30 '23 at 17:49