在 EPS 的 XMP 元数据中添加命名值 | Node.js

为了在 EPS 文件的 XMP 元数据中添加命名值,需要调用 AsposeXMPAddNamedValue 并将文件内容、文件名称以及结果文件名传递给它。

结果 JSON 包含 fileNameResult 中的文件名。


以下代码片段展示了如何在 Node.js 中向 EPS 文件的 XMP 元数据中添加命名值:

 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);

请参阅在 Java.NET 中的 XMP 元数据中添加命名值。

您可以从 GitHub下载示例和数据文件。

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.