Table of Contents

Class WatermarkOptions

Namespace
CobaltPdf.WebKit
Assembly
CobaltPDF.WebKit.dll

Visual settings for a watermark injected into the generated PDF.

public class WatermarkOptions
Inheritance
WatermarkOptions
Inherited Members

Properties

Color

public string? Color { get; set; }

Property Value

string

Horizontal

public HorizontalAlignment Horizontal { get; set; }

Property Value

HorizontalAlignment

Html

public string Html { get; set; }

Property Value

string

Opacity

public double Opacity { get; set; }

Property Value

double

Rasterize

When true, the watermark is flattened to a raster image baked into every page instead of injected as selectable text/vector content, so it can't be removed by selecting/deleting text in a PDF editor. Trade-offs: larger output, no selectable watermark text, slight pixelation at deep zoom. Tamper-resistance, not DRM. Ignored when post-processing is skipped (watermarks require pikepdf). Default false.

public bool Rasterize { get; set; }

Property Value

bool

Rotation

public int Rotation { get; set; }

Property Value

int

Vertical

public VerticalAlignment Vertical { get; set; }

Property Value

VerticalAlignment

Methods

WithColor(string)

public WatermarkOptions WithColor(string cssColor)

Parameters

cssColor string

Returns

WatermarkOptions

WithHtml(string)

public WatermarkOptions WithHtml(string html)

Parameters

html string

Returns

WatermarkOptions

WithOpacity(double)

public WatermarkOptions WithOpacity(double opacity)

Parameters

opacity double

Returns

WatermarkOptions

WithPosition(WatermarkPosition)

public WatermarkOptions WithPosition(WatermarkPosition position)

Parameters

position WatermarkPosition

Returns

WatermarkOptions

WithRasterize(bool)

Flattens the watermark to a raster image baked into every page so it can't be removed by selecting/deleting text in a PDF editor. Tamper-resistance, not DRM. enable defaults to true.

public WatermarkOptions WithRasterize(bool enable = true)

Parameters

enable bool

Returns

WatermarkOptions

WithRotation(int)

public WatermarkOptions WithRotation(int degrees)

Parameters

degrees int

Returns

WatermarkOptions

WithText(string, WatermarkStyle)

public static WatermarkOptions WithText(string text, WatermarkStyle style = WatermarkStyle.BoldStamp)

Parameters

text string
style WatermarkStyle

Returns

WatermarkOptions