Skip to main content

Add Text Watermark - Excel API

PDF4me Add Text Watermark enables you to add customizable text watermarks to Excel documents with font styling, transparency, and positioning control. This API service processes Excel files and adds text watermarks for security labels, branding, and confidentiality notices. The API receives Excel document content through REST API calls, utilizing Base64 encoding for secure transmission. This solution is ideal for document security, brand protection, and status indication workflows.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog →

Authenticating Your API Request​

Include your API key in the request to authenticate with the PDF4me REST API.

Key Features​

  • Custom Text Watermarks: Add any text as watermark (e.g., "Confidential", "DRAFT")
  • Font Customization: Control font family, size, and color
  • Transparency Control: Semi-transparent or fully opaque text
  • Positioning Options: Control placement and alignment

REST API Endpoint​

  • Method: POST
  • Endpoint: office/ApiV2Excel/ExcelAddWatermark

REST API Parameters​

Important: Parameters marked with an asterisk (*) are required. All requests use document, docContent, and addWatermarkToExcelAction. Operation-specific parameters (watermarkText, fontFamily, etc.) are properties of the action object.

Required Parameters (root level)​

ParameterRequiredWhat it doesExample
documentRequiredSource file. `Name` must end in `.xlsx`, `.xls` or `.xlsm` (a `.csv` for `ExcelParseCsv`).{ "Name": "data.xlsx" }
document.NameRequiredFile name including its extension. Type: string.{ "Name": "data.xlsx" }
docContentRequiredThe source file, base64-encoded. Type: string.UEsDBBQABgAIAAAA...
isAsyncOptionalProcess the request in the background. The call returns `202 Accepted`; poll the `Location` URL (`GetActionStatus`) for the result. Type: boolean.
addWatermarkToExcelActionRequiredObject carrying this operation's settings. Its fields are the addWatermarkToExcelAction rows below.See Payload example below
addWatermarkToExcelAction.watermarkTextOptionalThe watermark text. Type: string.
addWatermarkToExcelAction.fontFamilyOptionalFont name. Type: string.
addWatermarkToExcelAction.textSizeOptional`1` small, `2` medium, `3` large, `4` extra large. Type: integer.
addWatermarkToExcelAction.isBoldOptionalType: boolean.
addWatermarkToExcelAction.isItalicOptionalType: boolean.
addWatermarkToExcelAction.textColorOptionalHex color. Type: string.
addWatermarkToExcelAction.transparencyOptional`0` (opaque) to `100`. Type: integer.
addWatermarkToExcelAction.rotationAngleOptionalRotation in degrees. Type: integer.
addWatermarkToExcelAction.positionOptional`0` top-left, `1` top-center, `2` top-right, `3` middle-left, `4` center, `5` middle-right, `6` bottom-left, `7` bottom-center, `8` bottom-right. Type: integer.
addWatermarkToExcelAction.selectedWorksheetNamesOptionalWorksheet names. Type: array.
addWatermarkToExcelAction.selectedWorksheetIndexesOptional1-based worksheet numbers. Type: array.

Output​

The API returns the Excel document as a Base64-encoded string in JSON format (document, fileName, success, errorMessage).

Request Example​

Content-Type: application/json
Authorization: Basic YOUR_BASE64_ENCODED_API_KEY

Payload (Basic)​

{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"addWatermarkToExcelAction": {
"watermarkText": "Confidential"
}
}

Code Samples​

Get Help​