API referenceAnnotations

pdfWatermarkAnnot

Create a Watermark annotation on the current open page.

C
int32_t __stdcall pdfWatermarkAnnot(PPDF IPDF, double PosX, double PosY, double Width, double Height);
Delphi
function pdfWatermarkAnnot(const IPDF: PPDF; PosX, PosY, Width, Height: Double): Integer; stdcall;

Purpose. Create a Watermark annotation on the current open page.

Description. Watermark annotations have no interactive elements, so viewers do not let users select or edit their contents — useful for stamps that must stay put. The annotation is created without an appearance: call pdfCreateAnnotAP to create an appearance template, draw text/images/vector graphics into it, and close it with pdfEndTemplate. The annotation can be shared across pages with pdfAddAnnotToPage, and is removed by pdfDeleteWatermark when InclAnnots is true.

Parameters.

ParameterDescription
IPDFDocument handle.
PosX, PosY, Width, HeightAnnotation rectangle on the current page.

Return value. The annotation handle (>= 1) on success; a negative value on error.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfWatermarkAnnot(IntPtr IPDF, double PosX, double PosY, double Width, double Height);
Area
Annotations
Category

Core

Exported names

pdfWatermarkAnnot

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.