Skip to main content

Add Text Watermark to Word - Text Watermark API

PDF4me Add Text Watermark to Word enables you to add customizable text watermarks to Word documents with comprehensive styling and positioning control. This API service processes Word files and adds text watermarks with full control over text content, font family, font size, colors, rotation angles, orientation presets, and transparency levels. The API receives Word document content through REST API calls, utilizing Base64 encoding for secure transmission. With support for security labels, branding elements, confidentiality notices, and status markers, this solution is ideal for document security, brand protection, and status indication workflows.

Authenticating Your API Request

To access the PDF4me REST API, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user of the REST API.

Key Features

  • Text Watermark Support: Professional text watermarks with any custom text content
  • Font Customization: Full control over font family, font name, and font size
  • Color Options: Named colors, hex codes, RGB values, and 3-digit hex support
  • Rotation Control: Custom rotation angles (0-360°) or predefined orientation presets
  • Transparency Options: Semi-transparent or fully opaque watermark effects
  • Automatic Sizing: Intelligent sizing based on text length and font size
  • Document-wide Application: Watermarks applied to all sections and headers
  • Behind Text Placement: Watermarks positioned behind document content

REST API Endpoint

The PDF4me REST API uses standard HTTP methods to interact with resources. All text watermark addition operations are performed through a single endpoint:

  • Method: POST
  • Endpoint: office/ApiV2Word/AddTextWatermark

REST API Parameters

Complete list of parameters for the Add Text Watermark to Word REST API. Parameters are organized by category for better understanding and implementation.

Important: Parameters marked with an asterisk (*) are required and must be provided for the API to function correctly.

Required Parameters

ParameterTypeDescriptionExample
document*ObjectDocument descriptor. Must include Name (string): output Word file name with .docx extension{ "Name": "document.docx" }
docContent*Base64Word document content encoded in Base64UEsDBBQABgAIAAAA...
watermarkText*StringText to display as watermark. Required - cannot be null, empty, or whitespace only. Examples: "CONFIDENTIAL", "DRAFT", "APPROVED"CONFIDENTIAL

Optional Parameters

ParameterTypeDescriptionExample
fontFamilyStringFont family for watermark text. Common: "Arial", "Calibri", "Times New Roman", "Helvetica". Default: "Arial"Arial
fontSizeNumber (double)Font size in points (1 to 1000). Default: 7272
fontColorStringText color. Named: "Red", "Blue", "Gray". Hex: "#FF0000", "FF0000". RGB: "RGB(255,0,0)". Default: "#808080"#FF0000
semiTransparentBooleanTransparency. true = opacity 50%, false = 100% (default)true
rotationNumber (double)Custom rotation angle (0-360°). Default: 045
fontNameStringFont name for watermark textArial
orientationStringPredefined orientation: Horizontal (0°), Vertical (90°), Diagonal (45°), Upside-Down (180°). Overrides rotation if providedDiagonal
cultureNameStringCulture code (e.g., "en-US", "de-DE", "fr-FR"). Default: nullen-US

Text Orientation Options

The watermark text orientation follows this parameter priority:

  1. orientation - If provided, uses predefined orientation angle
  2. rotation - If orientation not provided, uses custom rotation angle
  3. Default - If neither provided, uses 0° (horizontal)

Predefined Orientations:

  • Horizontal: 0° (default)
  • Vertical: 90°
  • Diagonal: 45°
  • Upside-Down: 180°

Output

The PDF4me Add Text Watermark to Word REST API returns a JSON response (ApiV2WordApiCallRes). On success the API returns the Word document as a Base64-encoded string in the document field, not as binary data.

Success Response

Status Code: 200 OK

Content-Type: application/json

Response Body:

{
"document": "UEsDBBQABgAIAAAAIQDfpNJsWgEAACAFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC...",
"fileName": "document.docx",
"success": true,
"errorMessage": null
}

Response Fields:

  • document (string): The Word document with text watermark applied, encoded as Base64
  • fileName (string): The output Word file name
  • success (boolean): Whether the operation succeeded
  • errorMessage (string): Error message if success is false; otherwise null

How to Use:

  1. Check success; if true, extract the document field from the JSON response
  2. Decode the Base64 string to get the binary Word document data
  3. Save or process the Word file using fileName

Example (JavaScript):

const response = await fetch(url, options);
const data = await response.json();
if (!data.success) throw new Error(data.errorMessage);
const wordBytes = atob(data.document);
// Save or process wordBytes

Request Example

Content-Type: application/json
Authorization: Basic YOUR_BASE64_ENCODED_API_KEY

Note:

  • Get your API key from the PDF4me Dashboard
  • The API key must be Base64 encoded and prefixed with "Basic " in the Authorization header
  • Example: If your API key is abc123, encode it to Base64 and use Authorization: Basic YWJjMTIz

Payload

Basic Example (Required Fields Only):

{
"document": { "Name": "document.docx" },
"docContent": "UEsDBBQABgAIAAAAIQDfpNJsWgEAACAFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC...",
"watermarkText": "CONFIDENTIAL"
}

Advanced Example (With Optional Fields):

{
"document": { "Name": "document.docx" },
"docContent": "UEsDBBQABgAIAAAAIQDfpNJsWgEAACAFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC...",
"watermarkText": "CONFIDENTIAL",
"orientation": "Diagonal",
"fontFamily": "Arial",
"fontSize": 72,
"fontColor": "#FF0000",
"semiTransparent": true,
"cultureName": "en-US"
}

Custom Rotation Example:

{
"document": { "Name": "document.docx" },
"docContent": "UEsDBBQABgAIAAAAIQDfpNJsWgEAACAFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC...",
"watermarkText": "DRAFT",
"fontFamily": "Times New Roman",
"fontSize": 48,
"fontColor": "Gray",
"rotation": 45,
"semiTransparent": true
}

Code Samples

The PDF4me Add Text Watermark to Word REST API provides code samples in multiple programming languages. Choose the language that best fits your development environment:

C# (CSharp) Sample

Complete C# implementation for adding text watermarks to Word documents:

Industry Use Cases & Applications

Legal & Professional Services Use Cases

  • Confidential Documents: Watermark legal documents with "CONFIDENTIAL" notices
  • Draft Contracts: Mark draft agreements with "DRAFT - UNDER REVIEW" status
  • Privilege Labels: Apply "ATTORNEY-CLIENT PRIVILEGE" text watermarks
  • Status Markers: Indicate "APPROVED" or "PENDING REVIEW" status

Get Help