Add XML namespace in XMP metadata of EPS | NodeJS
To add an XML namespace in the XMP metadata of an EPS file, it is necessary to call AsposeXMPAddNamespace and pass the file content, its name, the result file name, the prefix, url, and an array of key-value pairs for the new namespace.
The result JSON contains the file name in the fileNameResult.
The following code snippet shows how to add an XML namespace in XMP metadata in an EPS file in NodeJS:
1const AsposePage = require('asposepagenodejs');
2
3const ps_file = "./data/program_13.ps";
4
5console.log("Aspose.Page for Node.js via C++ examples.");
6
7AsposePage().then(AsposePageModule => {
8
9 const prefix = "tmp";
10 const url = "http://www.some.org/schema/tmp#";
11 const input = [
12 ["tmp:newKey", "NewValue"]
13 ];
14 const JSON = AsposePageModule.AsposeXMPAddNamespace(ps_file, "result4.eps", prefix, url, input);
15 console.log("AsposeXMPAddNamespace => %O", JSON.errorCode == 0 ? JSON.fileNameResult : JSON.errorText);
16
17},
18 reason => {console.log(`The unknown error has occurred: ${reason}`);}
19);
You can download examples and data files from GitHub.