TPDFlibCompositeWatermark

Data types, page layout

Description

TPDFlibCompositeWatermark is the concrete TPDFlibWatermarkBase subclass that groups child watermarks and applies all of them in one ApplyWatermark call

Add any mix of TPDFlibTextWatermark, TPDFlibImageWatermark and TPDFlibShapeWatermark instances with Add; the composite owns the children and frees them in its destructor

The composite applies every child to the same PageRange; each child keeps its own Position and Opacity settings, and the composite page range is pushed down to children that have an empty page range

Syntax

Delphi

TPDFlibCompositeWatermark = Class(TPDFlibWatermarkBase)
  Public
    Constructor Create; Override;
    Destructor Destroy; Override;
    Procedure Add(Item: TPDFlibWatermarkBase);
    Property Count: Integer Read GetCount;
    Property Items[Index: Integer]: TPDFlibWatermarkBase Read GetItem; Default;
    Function Apply(Lib: TObject): Integer; Override;
  End;

Methods

AddAppends a child watermark; the composite takes ownership
CountNumber of child watermarks held
ItemsAccesses a child by zero-based index; the property is the class default

Return value

Apply returns the number of pages the child watermarks were placed on

Remarks

Use a composite when one stamp needs several layers, for example a shape band with centred text on top of the same pages

See also

ApplyWatermark, TPDFlibWatermarkBase, TPDFlibTextWatermark, TPDFlibImageWatermark, TPDFlibShapeWatermark