Skip to content

Commit b984e5b

Browse files
Update deleteMetadata.js
1 parent 748eded commit b984e5b

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

UsesCases/Metadatas/remove/deleteMetadata.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@
66
// 6. Perform some action after successful addition
77
// All values of variables starting with "YOUR_****" should be replaced by real user values
88

9-
import credentials from "../../../../Credentials/credentials.json" with { type: "json" };
9+
import credentials from "./credentials.json" with { type: "json" };
1010
import fs from 'node:fs/promises';
1111
import path from 'node:path';
12-
import { PdfApi } from "../../../src/api/api.js";
13-
import { XmpMetadata } from "../../../src/models/xmpMetadata.js";
14-
import { XmpMetadataProperty } from "../../../src/models/xmpMetadataProperty.js";
12+
import { PdfApi } from "asposepdfcloud";
13+
import { XmpMetadata } from "asposepdfcloud/src/models/xmpMetadata.js";
14+
import { XmpMetadataProperty } from "asposepdfcloud/src/models/xmpMetadataProperty.js";
1515

1616
const configParams = {
1717
LOCAL_FOLDER: "C:\\Samples\\",
1818
PDF_DOCUMENT_NAME: "sample.pdf",
1919
LOCAL_RESULT_DOCUMENT_NAME: "output_sample.pdf",
20-
NEW_LINK_ACTION: "https://reference.aspose.cloud/pdf/#/",
21-
PAGE_NUMBER: 2, // Your document page number...
22-
LINK_POS_LLX: 244.914,
23-
LINK_POS_LLY: 488.622,
24-
LINK_POS_URX: 284.776,
25-
LINK_POS_URY: 498.588,
2620
};
2721

2822
const pdfApi = new PdfApi(credentials.id, credentials.key);
@@ -47,15 +41,13 @@ const pdfMetadatas = {
4741
if (responseMetadata.response.status == 200)
4842
{
4943
const props = responseMetadata.body.properties;
50-
for (var i = 0; i < props.length; i++)
51-
{
52-
console.log(props[i]);
53-
}
44+
props.forEach((prop) =>{
45+
console.log(prop.key);
46+
});
5447
}
5548
},
5649

5750
async deleteMetadata () {
58-
5951
const prop = new XmpMetadataProperty();
6052
prop.key = 'dc:creator';
6153
prop.value = null;
@@ -71,7 +63,6 @@ const pdfMetadatas = {
7163
return true;
7264
}
7365
},
74-
7566
}
7667

7768
async function main() {
@@ -86,4 +77,4 @@ async function main() {
8677
}
8778
}
8879

89-
main();
80+
main();

0 commit comments

Comments
 (0)