6
6
// 6. Perform some action after successful addition
7
7
// All values of variables starting with "YOUR_****" should be replaced by real user values
8
8
9
- import credentials from "../../../../Credentials /credentials.json" with { type : "json" } ;
9
+ import credentials from "./credentials.json" with { type : "json" } ;
10
10
import fs from 'node:fs/promises' ;
11
11
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" ;
15
15
16
16
const configParams = {
17
17
LOCAL_FOLDER : "C:\\Samples\\" ,
18
18
PDF_DOCUMENT_NAME : "sample.pdf" ,
19
19
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 ,
26
20
} ;
27
21
28
22
const pdfApi = new PdfApi ( credentials . id , credentials . key ) ;
@@ -47,15 +41,13 @@ const pdfMetadatas = {
47
41
if ( responseMetadata . response . status == 200 )
48
42
{
49
43
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
+ } ) ;
54
47
}
55
48
} ,
56
49
57
50
async deleteMetadata ( ) {
58
-
59
51
const prop = new XmpMetadataProperty ( ) ;
60
52
prop . key = 'dc:creator' ;
61
53
prop . value = null ;
@@ -71,7 +63,6 @@ const pdfMetadatas = {
71
63
return true ;
72
64
}
73
65
} ,
74
-
75
66
}
76
67
77
68
async function main ( ) {
@@ -86,4 +77,4 @@ async function main() {
86
77
}
87
78
}
88
79
89
- main ( ) ;
80
+ main ( ) ;
0 commit comments