API referenceCore SDK

pdfResetWatermark

Configure the document watermark, one typed property at a

C
SI32 __stdcall pdfSetWatermarkIntProperty(PPDF IPDF, TWatermarkProperty Tag, SI32 NewValue);
SI32 __stdcall pdfSetWatermarkDblProperty(PPDF IPDF, TWatermarkProperty Tag, double NewValue);
SI32 __stdcall pdfSetWatermarkClrProperty(PPDF IPDF, TWatermarkProperty Tag, SI32 CS, UI32 Color);
SI32 __stdcall pdfSetWatermarkStrPropertyA(PPDF IPDF, TWatermarkProperty Tag, char* NewValue);
SI32 __stdcall pdfSetWatermarkStrPropertyW(PPDF IPDF, TWatermarkProperty Tag, const wchar_t* NewValue);
BOOL32 __stdcall pdfResetWatermark(PPDF IPDF);
Delphi
function pdfSetWatermarkIntProperty(const IPDF: PPDF; Tag: TWatermarkProperty; NewValue: Integer): Integer; stdcall;
function pdfSetWatermarkDblProperty(const IPDF: PPDF; Tag: TWatermarkProperty; NewValue: Double): Integer; stdcall;
function pdfSetWatermarkClrProperty(const IPDF: PPDF; Tag: TWatermarkProperty; CS: Integer; Color: Cardinal): Integer; stdcall;
function pdfSetWatermarkStrPropertyA(const IPDF: PPDF; Tag: TWatermarkProperty; NewValue: PAnsiChar): Integer; stdcall;
function pdfSetWatermarkStrPropertyW(const IPDF: PPDF; Tag: TWatermarkProperty; NewValue: PWideChar): Integer; stdcall;
function pdfResetWatermark(const IPDF: PPDF): LongBool; stdcall;

Purpose. Configure the document watermark, one typed property at a time, before it is applied — text, placement, rotation, colors, opacity, tiling and the rest of the TWatermarkProperty (wmp*) vocabulary.

Description. The watermark is a property bag: each setter stores one tagged value into the document's pending watermark configuration, choosing the setter that matches the property's type — integers and enumerations through the Int form, measurements and angles through Dbl, colors through Clr (a color space selector plus the color value), text and font names through Str (A/W). The configured watermark is applied by the watermark placement calls, which then render it on the selected pages. pdfResetWatermark returns every property to its default so a fresh configuration can start from a known state. Setting a property whose tag does not accept the given type is refused rather than coerced.

Parameters.

ParameterDescription
IPDFDocument handle.
TagThe TWatermarkProperty (wmp*) constant being set.
NewValue / CS+ColorThe typed value for that property.

Return value. The setters answer 1 when the property is stored and 0 when the tag/type combination is refused; pdfResetWatermark answers True once defaults are restored.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Core

Exported names

pdfResetWatermark

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.