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.

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)

ParameterTypeDescriptionExample
document*ObjectDocument reference with Name (Excel file name, .xlsx or .xls){ "Name": "data.xlsx" }
docContent*String (Base64)Excel document content encoded in Base64UEsDBBQABgAIAAAA...
addWatermarkToExcelAction*ObjectAction configuration. Must contain at least watermarkText (string) — text to display as watermarkSee Payload example below

Optional Parameters (inside addWatermarkToExcelAction)

ParameterTypeDescriptionExample
fontFamilyStringFont family name. Default: ArialArial
fontSizeNumberFont size in points. Default: 7248
fontColorStringHex color or color name. Default: black#808080
semiTransparentBooleantrue = 50% opacity, false = 100% (default)true
cultureNameStringCulture code for text renderingen-US

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