Hi,
When trying to add XMP data to a pdf everything seems fine but when validating this pdf against an online testing tool (http://www.pdflib.com/knowledge-base/xmp-metadata/free-xmp-validator/
) I get the following response;
XMP data is invalid
Reason: XMP metadata: Custom property for predefined schema ‘xmp’ doesn’t have description embedded
Uncommenting the line
xmpMetaData.RegisterNamespaceURI(“xmp”, “http://ns.adobe.com/xap/1.0/”);
Makes no difference. What am I missing?
Below is the code I used:
private void AddXmpToPdf()
{
//Open document
var strPDFFileName = @“C:\test.pdf”;
//create an object of PdfXmpMetadata class
var xmpMetaData = new Aspose.Pdf.Facades.PdfXmpMetadata();
//create input and output file streams
var input = new FileStream(strPDFFileName, FileMode.Open);
//set input file stream
xmpMetaData.BindPdf(input);
[//xmpMetaData.RegisterNamespaceURI](https://xmpmetadata.registernamespaceuri/)(“xmp”, “http://ns.adobe.com/xap/1.0/”);
xmpMetaData.Add(“xmp:myspecialfield”, “myfield”);
//Save document
xmpMetaData.Save(@“C:\output.pdf”);
//close input and output file streams
input.Close();
}