Get XMP metadata from EPS file using NodeJS
In order to extract XMP metadata from an EPS file, it is necessary to call AsposeEPSGetXMP 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 extract XMP metadata from EPS files 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 JSON = AsposePageModule.AsposeEPSGetXMP(ps_file, "result1.eps");
10 console.log("AsposeEPSGetXMP => %O", JSON.errorCode == 0 ? JSON.fileNameResult : JSON.errorText);
11
12},
13 reason => {console.log(`The unknown error has occurred: ${reason}`);}
14);
You can download examples and data files from GitHub.