XML API - pdx:watermarkDocx

pdx:watermarkDocx

Inserts a watermark into a Word document.

Note

You are reading the XML API documentation. For the PHP API method please go to watermarkDocx.

Description

Element definition

This element allows you to insert a watermark image or text in a Word document.

Attributes and sub-elements

src

Path to the Word document.

target

Path to the resulting watermarked document.

type

Watermark type: 'text' or 'image'.

section

Section number.

options

The possible keys and values are (required options are shown with yellow background):

If type is 'image':

Key Description
image Path to the watermark image.
height Watermark image height in pixels (optional).
width Watermark image width in pixels (optional).
decolorate If true (default) decolorates the image.
gain Optional value to customize decoloration: hexadecimal value.
blacklevel Optional value to customize decoloration: hexadecimal value.
scope Header (default) or footer.
remove_previous_watermarks If true (default) removes previous watermarks.

If type is 'text':

Key Description
text The string of text used for watermarking.
text_orientation Orientation: diagonal (default) or horizontal.
height Watermark text height in pixels (optional).
width Watermark text width in pixels (optional).
font The font-family. If not set defaults to Calibri.
color Hexadecimal value or color name (defaults to silver).
opacity Decimal number between 0 and 1. If not set defaults to 0.5
scope Header (default) or footer.
remove_previous_watermarks If true (default) removes previous watermarks.
Code samples

Example #1

config.xml

content.xml

settings.xml

PHP code

The resulting Word document looks like: