Interface Watermark

All Known Implementing Classes:
ImageWatermark, TextWatermark

public sealed interface Watermark permits TextWatermark, ImageWatermark
Optional decoration centered on the physical page and drawn behind letter content. Watermarks do not reserve space or alter pagination. JSON chooses the concrete record through kind, using text or image. The document may omit a watermark entirely.

Generation validates selection, opacity, rotation, and subtype-specific content. Nullable numeric components in watermark records are not inherited style overrides and are not defaulted by their canonical constructors; use subtype factories for defaults.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns paint opacity, where zero is invisible and one is fully opaque.
    Returns the pages on which to paint the decoration.
    Returns rotation about the physical page center.
  • Method Details

    • pages

      PageSelector pages()
      Returns the pages on which to paint the decoration.
      Returns:
      selection required during generation
    • opacity

      Double opacity()
      Returns paint opacity, where zero is invisible and one is fully opaque.
      Returns:
      finite value from zero through one, required during generation
    • rotationDegrees

      Double rotationDegrees()
      Returns rotation about the physical page center. Positive values rotate counterclockwise in PDF coordinates; zero leaves the decoration horizontal.
      Returns:
      finite rotation in degrees, required during generation