pdx:watermarkDocx

Inserts a watermark into a Word document.

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.
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
remove_previous_watermarks If true (default) removes previous watermarks.
Code samples
#Example 1

config.xml

content.xml

settings.xml

The resulting Word document looks like: