Add named value in XMP metadata of EPS | Node.js
In order to add named value in XMP metadata of EPS file, it is necessary to call AsposeXMPAddNamedValue and pass the file content, its name, and the result file name to it.
The result JSON contains the file name in the fileNameResult.
The following code snippet shows how to add a named value in XMP metadata in EPS file in Node.js:
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 input = [
10 ["xmpTPg:MaxPageSize", [["stDim:newKey", "NewValue"],["stDim:newKey2", "NewValue2"]] ],
11 ["xmpTPg:SwatchGroups", [["xmpG:newKey", "NewValue"]] ]
12 ];
13 const JSON = AsposePageModule.AsposeXMPAddNamedValue(ps_file, "result3.eps", input);
14 console.log("AsposeXMPAddNamedValue => %O", JSON.errorCode == 0 ? JSON.fileNameResult : JSON.errorText);
15
16},
17 reason => {console.log(`The unknown error has occurred: ${reason}`);}
18);
You can download the examples and data files from GitHub.