问题
How can I read XMP from an existing PDF file using iTextSharp?
回答1:
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);
回答2:
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.
来源:https://stackoverflow.com/questions/1522101/read-xmp-from-existing-pdf-with-itextsharp