THPDFWatermarkBase Record
Unified watermark descriptor that text and shape watermarks share: angle, layering, placement, opacity and stroke settings
Declaration
THPDFWatermarkBase= record
Angle: Extended;
Overlay: boolean;
HorizPos: THPDFWatermarkHorizPos;
VertPos: THPDFWatermarkVertPos;
X, Y: Single;
OpacityStroke: Single;
OpacityFill: Single;
StrokeColor: TColor;
PenWidth: Single;
class function Default: THPDFWatermarkBase; static;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
Angle | Rotation in degrees; 0, 45, 90, 180 and 270 receive anchor correction so that the watermark stays on the page |
Overlay | True draws on top of existing page content; false, the underlay case, draws beneath it |
HorizPos | Horizontal placement preset; hpCustom keeps the literal X value, whilst every other value recomputes X from the MediaBox |
VertPos | Vertical placement preset; vpCustom keeps the literal Y value as given |
X, Y | Anchor coordinates used where both position presets are custom |
OpacityStroke | Stroke opacity from 0 to 1, applied by way of the extended graphics state |
OpacityFill | Fill opacity running from 0 to 1 |
StrokeColor | Pen colour used for text and shape outlines |
PenWidth | Pen width used when drawing strokes |
Usage notes
- Start from
THPDFWatermarkBase.Default, which gives 0 degrees, overlay drawing, a custom position at the origin, full opacity, a black stroke and pen width 1 - The same record drives
AddTextWatermarkExand each shape watermark variant, so a single placement configuration serves text and graphics templates alike - Non-custom
HorizPos/VertPospresets let the watermark adapt to pages of differing sizes without per-page coordinates