TPDFlibTextWatermark

Data types, page layout

Description

TPDFlibTextWatermark is the concrete TPDFlibWatermarkBase subclass that stamps a text run onto a page range

Set Text, FontID, FontSize and the R, G, B text colour, configure placement on the inherited fields, then pass the instance to ApplyWatermark

Syntax

Delphi

TPDFlibTextWatermark = Class(TPDFlibWatermarkBase)
  Public
    Text: WideString;
    FontID: Integer;
    FontSize: Double;
    R, G, B: Double;
    Constructor Create; Override;
    Function Apply(Lib: TObject): Integer; Override;
  End;

Fields

TextThe Unicode text to stamp
FontIDA standard-14 font id or the id of a font previously added to the document
FontSizeThe font size in the current measurement units
R, G, BThe text colour components in the range 0 to 1

Return value

Apply returns the number of pages the watermark was placed on

Remarks

The inherited Position, X, Y, Angle, Opacity and PageRange fields control placement exactly as on the base class

The watermark approximates the text extent from the font metrics so the nine-point Position presets can centre the run on the page

See also

ApplyWatermark, TPDFlibWatermarkBase, TPDFlibCompositeWatermark, AddTrueTypeFontFromFile