Skip to content

Commit

Permalink
Aspose.PDF for Node.js via C++: AsposePdfAddWatermark, AsposePdfDelet…
Browse files Browse the repository at this point in the history
…eWatermarks
  • Loading branch information
OleksandrAndriienko committed Oct 11, 2024
1 parent 90a58ad commit 5377df1
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 0 deletions.
2 changes: 2 additions & 0 deletions english/nodejs-cpp/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ is_root: true
| [AsposePdfValidatePDFA](./organize/asposepdfvalidatepdfa/) | Validate PDF/A compatibility a PDF-file. |
| [AsposePdfFindHiddenText](./organize/asposepdffindhiddentext/) | Find hidden text in a PDF-file. |
| [AsposePdfDeleteHiddenText](./organize/asposepdfdeletehiddentext/) | Delete hidden text from a PDF-file. |
| [AsposePdfAddWatermark](./organize/asposepdfaddwatermark/) | Add watermark to a PDF-file. |
| [AsposePdfDeleteWatermarks](./organize/asposepdfdeletewatermarks/) | Delete watermarks from a PDF-file. |


## Metadata PDF functions
Expand Down
2 changes: 2 additions & 0 deletions english/nodejs-cpp/organize/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ url: /nodejs-cpp/organize/
| [AsposePdfValidatePDFA](./asposepdfvalidatepdfa/) | Validate PDF/A compatibility a PDF-file. |
| [AsposePdfFindHiddenText](./asposepdffindhiddentext/) | Find hidden text in a PDF-file. |
| [AsposePdfDeleteHiddenText](./asposepdfdeletehiddentext/) | Delete hidden text from a PDF-file. |
| [AsposePdfAddWatermark](./asposepdfaddwatermark/) | Add watermark to a PDF-file. |
| [AsposePdfDeleteWatermarks](./asposepdfdeletewatermarks/) | Delete watermarks from a PDF-file. |


## Detailed Description
Expand Down
71 changes: 71 additions & 0 deletions english/nodejs-cpp/organize/asposepdfaddwatermark/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: "AsposePdfAddWatermark"
second_title: Aspose.PDF for Node.js via C++
description: "Add watermark to a PDF-file."
type: docs
url: /nodejs-cpp/organize/asposepdfaddwatermark/
---

_Add watermark to a PDF-file._

```js
function AsposePdfAddWatermark(
fileName,
text,
fontName,
fontSize,
foregroundColor,
xPosition,
yPosition,
rotation,
isBackground,
opacity,
fileNameResult
)
```

**Parameters**:

* **fileName** file name
* **text** watermark text
* **fontName** font name
* **fontSize** font size
* **foregroundColor** text color (hexadecimal format "#RRGGBB", where RR-red, GG-green and BB-blue hexadecimal integers)
* **xPosition** x watermark position
* **yPosition** y watermark position
* **rotation** watermark rotation (0-360)
* **isBackground** background (1 or 0)
* **opacity** opacity (decimal)
* **fileNameResult** result file name

**Return**:

JSON object

* **errorCode** - code error (0 no error)
* **errorText** - text error ("" no error)
* **fileNameResult** - result file name


**CommonJS**:

```js
const AsposePdf = require('asposepdfnodejs');
const pdf_file = 'Aspose.pdf';
AsposePdf().then(AsposePdfModule => {
/*Add watermark to a PDF-file and save the "ResultWatermark.pdf"*/
const json = AsposePdfModule.AsposePdfAddWatermark(pdf_file, "Aspose PDF", "Arial", 32, "#010101", 100, 100, 45, 1, 0.5, "ResultAddWatermark.pdf");
console.log("AsposePdfAddWatermark => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
});
```

**ECMAScript/ES6**:

```js
import AsposePdf from 'asposepdfnodejs';
const AsposePdfModule = await AsposePdf();
const pdf_file = 'Aspose.pdf';
/*Add watermark to a PDF-file and save the "ResultWatermark.pdf"*/
const json = AsposePdfModule.AsposePdfAddWatermark(pdf_file, "Aspose PDF", "Arial", 32, "#010101", 100, 100, 45, 1, 0.5, "ResultAddWatermark.pdf");
console.log("AsposePdfAddWatermark => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
```
51 changes: 51 additions & 0 deletions english/nodejs-cpp/organize/asposepdfdeletewatermarks/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "AsposePdfDeleteWatermarks"
second_title: Aspose.PDF for Node.js via C++
description: "Delete watermarks from a PDF-file."
type: docs
url: /nodejs-cpp/organize/asposepdfdeletewatermarks/
---

_Delete watermarks from a PDF-file._

```js
function AsposePdfDeleteWatermarks(
fileName,
fileNameResult
)
```

**Parameters**:

* **fileName** file name
* **fileNameResult** result file name

**Return**:
JSON object
* **errorCode** - code error (0 no error)
* **errorText** - text error ("" no error)
* **fileNameResult** - result file name


**CommonJS**:

```js
const AsposePdf = require('asposepdfnodejs');
const pdf_file = 'Aspose.pdf';
AsposePdf().then(AsposePdfModule => {
/*Delete watermarks from a PDF-file and save the "ResultPdfDeleteWatermarks.pdf"*/
const json = AsposePdfModule.AsposePdfDeleteWatermarks(pdf_file, "ResultPdfDeleteWatermarks.pdf");
console.log("AsposePdfDeleteWatermarks => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
});
```

**ECMAScript/ES6**:

```js
import AsposePdf from 'asposepdfnodejs';
const AsposePdfModule = await AsposePdf();
const pdf_file = 'Aspose.pdf';
/*Delete watermarks from a PDF-file and save the "ResultPdfDeleteWatermarks.pdf"*/
const json = AsposePdfModule.AsposePdfDeleteWatermarks(pdf_file, "ResultPdfDeleteWatermarks.pdf");
console.log("AsposePdfDeleteWatermarks => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
```

0 comments on commit 5377df1

Please sign in to comment.