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);
È possibile scaricare esempi e file di dati da GitHub.