Skip to content

Commit a131e18

Browse files
Update removeStamps.js
1 parent 4b36ed0 commit a131e18

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

UsesCases/Stamps/remove/removeStamps.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
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" };
102
import fs from 'node:fs/promises';
113
import path from 'node:path';
12-
import { PdfApi } from "asposepdfcloud";
4+
import { PdfApi } from "../../../src/api/api.js";
135

146
const configParams = {
157
LOCAL_FOLDER: "C:\\Samples\\",
16-
PDF_DOCUMENT_NAME: "sample.pdf",
17-
PDF_STAMP_FILE: "pdf_stamp.pdf",
8+
PDF_DOCUMENT_NAME: "pdf_stamp.pdf",
189
LOCAL_RESULT_DOCUMENT_NAME: "output_sample.pdf",
1910
PAGE_NUMBER: 2, // Your document page number...
2011
STAMP_ID: "GE5TCOZQ", // Your Stamp Id to be deleted...
@@ -27,6 +18,7 @@ const pdfStamps = {
2718
const fileNamePath = path.join(configParams.LOCAL_FOLDER, configParams.PDF_DOCUMENT_NAME);
2819
const pdfFileData = await fs.readFile(fileNamePath);
2920
await pdfApi.uploadFile(configParams.PDF_DOCUMENT_NAME, pdfFileData);
21+
console.log("File '" + configParams.PDF_DOCUMENT_NAME + "' successfully uploaded!");
3022
},
3123

3224
async downloadResult () {

0 commit comments

Comments
 (0)