Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jul 17, 2014 4:16 pm

I am trying to access custom Metadata from a PDF document and have been evaluating the Custom Metadata functionality that you advertise as a feature of your product. Unfortunately, I do not see any reference to it anywhere except the mention in your product description the featureset for Spire.pdf and samples from other tools. Can you point me to an example where I can see how to access the custom metadata in a PDF Document? To be clear, I do not mean the standardized metadata fields such as title, subject, etc.

DavidSilverlight
 
Posts: 2
Joined: Fri Jun 20, 2014 3:59 am

Fri Jul 18, 2014 8:21 am

Hello,

Thanks for your inquiry.
There are some codes for your reference.
For getting metadata
Code: Select all
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile("result.pdf", FileFormat.PDF);
XmpMetadata meta = pdf.DocumentInformation.GetMetaData();
XmlDocument xmlfile = meta.XmlData;
xmlfile.Save("result.xml");

For setting metadata
Code: Select all
XmlDocument xmp=new XmlDocument();
xmp.Load("xmp.xml);
document.XmpMetaData.Load(xmp);

If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Sat Jul 19, 2014 3:59 am

Thanks for the reply, but I should have mentioned that I am using the Silverlight component and XmpMetadata does not appear to be supported, although the feature set lists it as part of the Silverlight version. Is it correct to say that it is not supported for Silverlight or am I missing a reference in my Silverlight project?

DavidSilverlight
 
Posts: 2
Joined: Fri Jun 20, 2014 3:59 am

Mon Jul 21, 2014 6:41 am

Hello,

Thanks for your feedback.
Sorry that currently it is not supported for Silverlight. And we have added it to our schedule, once it is supported, we will let you know.
If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.PDF