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.
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)
| Parameter | Type | Description | Example |
|---|---|---|---|
| document* | Object | Document reference with Name (Excel file name, .xlsx or .xls) | { "Name": "data.xlsx" } |
| docContent* | String (Base64) | Excel document content encoded in Base64 | UEsDBBQABgAIAAAA... |
| addWatermarkToExcelAction* | Object | Action configuration. Must contain at least watermarkText (string) — text to display as watermark | See Payload example below |
Optional Parameters (inside addWatermarkToExcelAction)
| Parameter | Type | Description | Example |
|---|---|---|---|
| fontFamily | String | Font family name. Default: Arial | Arial |
| fontSize | Number | Font size in points. Default: 72 | 48 |
| fontColor | String | Hex color or color name. Default: black | #808080 |
| semiTransparent | Boolean | true = 50% opacity, false = 100% (default) | true |
| cultureName | String | Culture code for text rendering | en-US |
Output
The API returns the Excel document as a Base64-encoded string in JSON format (document, fileName, success, errorMessage).
Request Example
Header
Content-Type: application/json
Authorization: Basic YOUR_BASE64_ENCODED_API_KEY
Payload (Basic)
{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"addWatermarkToExcelAction": {
"watermarkText": "Confidential"
}
}