1
- // 1. Load your Application Secret and Key from the JSON file or set credentials in another way
2
- // 2. Create an object to connect to the Pdf.Cloud API
3
- // 3. Upload your document file
4
- // 4. Create a new Link Annotation with the required properties
5
- // 5. Append new Link Annotation to the document using postPageLinkAnnotations() function
6
- // 6. Perform some action after successful addition
7
- // All values of variables starting with "YOUR_****" should be replaced by real user values
8
-
9
- import credentials from "./credentials.json" with { type : "json" } ;
1
+ import credentials from "../../../../Credentials/credentials.json" with { type : "json" } ;
10
2
import fs from 'node:fs/promises' ;
11
3
import path from 'node:path' ;
12
- import { PdfApi } from "asposepdfcloud " ;
4
+ import { PdfApi } from "../../../src/api/api.js " ;
13
5
14
6
const configParams = {
15
7
LOCAL_FOLDER : "C:\\Samples\\" ,
16
- PDF_DOCUMENT_NAME : "sample.pdf" ,
17
- PDF_STAMP_FILE : "pdf_stamp.pdf" ,
8
+ PDF_DOCUMENT_NAME : "pdf_stamp.pdf" ,
18
9
LOCAL_RESULT_DOCUMENT_NAME : "output_sample.pdf" ,
19
10
PAGE_NUMBER : 2 , // Your document page number...
20
11
STAMP_ID : "GE5TCOZQ" , // Your Stamp Id to be deleted...
@@ -27,6 +18,7 @@ const pdfStamps = {
27
18
const fileNamePath = path . join ( configParams . LOCAL_FOLDER , configParams . PDF_DOCUMENT_NAME ) ;
28
19
const pdfFileData = await fs . readFile ( fileNamePath ) ;
29
20
await pdfApi . uploadFile ( configParams . PDF_DOCUMENT_NAME , pdfFileData ) ;
21
+ console . log ( "File '" + configParams . PDF_DOCUMENT_NAME + "' successfully uploaded!" ) ;
30
22
} ,
31
23
32
24
async downloadResult ( ) {
0 commit comments