Class WatermarkOptions
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
Horizontal
public HorizontalAlignment Horizontal { get; set; }
Property Value
Html
public string Html { get; set; }
Property Value
Opacity
public double Opacity { get; set; }
Property Value
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
Rotation
public int Rotation { get; set; }
Property Value
Vertical
public VerticalAlignment Vertical { get; set; }
Property Value
Methods
WithColor(string)
public WatermarkOptions WithColor(string cssColor)
Parameters
cssColorstring
Returns
WithHtml(string)
public WatermarkOptions WithHtml(string html)
Parameters
htmlstring
Returns
WithOpacity(double)
public WatermarkOptions WithOpacity(double opacity)
Parameters
opacitydouble
Returns
WithPosition(WatermarkPosition)
public WatermarkOptions WithPosition(WatermarkPosition position)
Parameters
positionWatermarkPosition
Returns
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
enablebool
Returns
WithRotation(int)
public WatermarkOptions WithRotation(int degrees)
Parameters
degreesint
Returns
WithText(string, WatermarkStyle)
public static WatermarkOptions WithText(string text, WatermarkStyle style = WatermarkStyle.BoldStamp)
Parameters
textstringstyleWatermarkStyle