Add array items in XMP metadata of EPS| Node.js

To add array items in XMP metadata of EPS file, it is necessary to call AsposeXMPAddArrayItem and pass the file content, its name, and the result file name to it.

If the EPS file doesn’t contain XMP metadata, we get a new one filled with values from PS metadata comments (%%Creator, %%CreateDate, %%Title, etc).

The result JSON contains the file name in fileNameResult and gets metadata in the XMP element.

The following code snippet shows how to add array items 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      ["dc:title", "NewTitle"],
11      ["dc:creator", "NewCreator"]
12    ];
13    const JSON = AsposePageModule.AsposeXMPAddArrayItem(ps_file, "result2.eps", input);
14    console.log("AsposeXMPAddArrayItem => %O",  JSON.errorCode == 0 ? JSON.fileNameResult : JSON.errorText);
15
16},
17    reason => {console.log(`The unknown error has occurred: ${reason}`);}
18);

See adding array items in XMP metadata in Java and .NET.

You can download examples and data files from GitHub.

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.