Skip to main content

Add Watermark to Word - Image Watermark API

PDF4me Add Watermark to Word enables you to add customizable image watermarks to Word documents with comprehensive positioning and styling control. This API service processes Word files and adds image watermarks with precise scaling, transparency levels, positioning alignment, and advanced sizing options. The API receives Word document content and watermark image data through REST API calls, utilizing Base64 encoding for secure transmission. With support for professional image watermarking using PNG, JPG, JPEG, BMP, and GIF formats, 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

  • Image Watermark Support: Professional image watermarks using PNG, JPG, JPEG, BMP, GIF formats
  • Advanced Scaling: Precise scaling control with Scale parameter (0.1 to 10.0)
  • Custom Dimensions: Override scaling with exact Width and Height in points
  • Transparency Control: Semi-transparent option for subtle watermark effects
  • Positioning Options: Center alignment or top-left positioning within margins
  • Document-wide Application: Watermarks applied to all sections and headers
  • Behind Text Placement: Watermarks positioned behind document content
  • Culture Support: Locale-specific document metadata handling

REST API Endpoint

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

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

REST API Parameters

Complete list of parameters for the Add 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 reference. Must contain Name (string) — Word file name with .docx extension{ "Name": "document.docx" }
docContent*Base64Word document content encoded in Base64UEsDBBQABgAIAAAA...
watermarkFileName*StringWatermark image file name with extension (e.g., .png, .jpg)watermark.png
watermarkFileContent*Base64Watermark image file content encoded in Base64. Supports PNG, JPG, JPEG, BMP, GIF formats. Recommended: Use transparent PNG for best resultsiVBORw0KGgoAAAANS...

Optional Parameters

ParameterTypeDescriptionExample
scaleNumber (float)Scaling factor for watermark image (0.1 to 10.0). 0.5 = 50% of original size, 1.0 = original size (default), 2.0 = 200% of original size. Overridden by Width/Height if provided1.5
semiTransparentBooleanTransparency control. true = Watermark opacity set to 50%, false = Watermark opacity set to 100% (default). Creates subtle watermark effect when truetrue
widthNumber (double)Watermark width in points (overrides Scale if provided). Must be positive value. If only Width provided, height calculated to maintain aspect ratio200
heightNumber (double)Watermark height in points (overrides Scale if provided). Must be positive value. If only Height provided, width calculated to maintain aspect ratio150
alignImageBooleanPositioning control. true = Center watermark on page (default), false = Align watermark to top-left within marginstrue
cultureNameStringCulture code for document metadata (e.g., "en-US", "fr-FR", "de-DE"). Default: null (no culture-specific processing). Affects document language and formattingen-US

Watermark Sizing Priority

The watermark sizing follows this parameter priority:

  1. Width/Height - If provided, these exact dimensions are used
  2. Scale - If Width/Height not provided, Scale is applied to original image dimensions
  3. Original Image Size - If neither Width/Height nor Scale provided, original image size is used

Output

The PDF4me Add Watermark to Word REST API returns different responses based on the processing mode. The API returns the Word document as a Base64-encoded string in JSON format, not as binary data.

Synchronous Processing (Default)

The API processes the request and returns:

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 watermark applied, encoded as Base64 string
  • fileName (string): The output Word file name
  • success (boolean): Indicates whether the request succeeded
  • errorMessage (string or null): Error details when success is false

How to Use:

  1. Extract the document field from the JSON response (Base64)
  2. Decode the Base64 string to get the binary Word document data
  3. Save or process the Word file as needed

Example (JavaScript):

const response = await fetch(url, options);
const data = await response.json();
const wordBytes = atob(data.document); // Decode Base64
// 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...",
"watermarkFileName": "watermark.png",
"watermarkFileContent": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
}

Advanced Example (With All Optional Fields):

{
"document": { "Name": "document.docx" },
"docContent": "UEsDBBQABgAIAAAAIQDfpNJsWgEAACAFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC...",
"watermarkFileName": "watermark.png",
"watermarkFileContent": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"scale": 1.5,
"semiTransparent": true,
"width": 200,
"height": 150,
"alignImage": true,
"cultureName": "en-US"
}

Code Samples

The PDF4me Add 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 watermarks to Word documents:

Industry Use Cases & Applications

Legal & Professional Services Use Cases

  • Confidential Documents: Watermark legal documents with confidentiality notices
  • Draft Contracts: Mark draft agreements with "DRAFT" status
  • Privilege Labels: Apply attorney-client privilege watermarks
  • Status Markers: Indicate document review or approval status

Get Help