Aggiungere elementi array nei metadati XMP di EPS | Node.js

Per aggiungere elementi array nei metadati XMP di un file EPS, è necessario chiamare AsposeXMPAddArrayItem e passargli il contenuto del file, il suo nome e il nome del file risultante.

Se il file EPS non contiene metadati XMP, ne otteniamo uno nuovo riempito con i valori dei commenti dei metadati PS (%%Creator, %%CreateDate, %%Title, ecc.).

Il JSON risultante contiene il nome del file in fileNameResult e riceve i metadati nell’elemento XMP.

Il seguente frammento di codice mostra come aggiungere elementi array nei metadati XMP di un file EPS 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);

Vedere l’aggiunta di elementi array nei metadati XMP in Java e .NET.

È possibile scaricare esempi e file di dati da GitHub.

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.