-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aspose.PDF for Node.js via C++: AsposePdfAddWatermark, AsposePdfDelet…
…eWatermarks
- Loading branch information
1 parent
90a58ad
commit 5377df1
Showing
4 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
english/nodejs-cpp/organize/asposepdfaddwatermark/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
51
english/nodejs-cpp/organize/asposepdfdeletewatermarks/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
``` |