XML API - pdx:watermarkPdf

pdx:watermarkPdf

Inserts a watermark into a PDF document.

Note

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

Description

Element definition

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

Attributes and sub-elements

src

Path to the PDF document.

target

Path to the resulting watermarked document.

type

Watermark type: 'text' or 'image'.

options

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

key Description
annotations Import annotations (links, comments and others).

If type is 'image':

Key Description
image Path to the watermark image.
positionX X-asis position (page center as default).
positionY Y-asis position (page center as default).
opacity Decimal number between 0 and 1(optional), if not set defaults to 0.5.

If type is 'text':

Key Description
text The string of text used for watermarking.
positionX X-asis position (page center as default).
positionY Y-asis position (page center as default).
opacity Decimal number between 0 and 1(optional), if not set defaults to 0.5.
font The font-family. It must be installed in the OS.
size Font size.
Code samples

Example #1

config.xml

content.xml

settings.xml

PHP code