Watermark

Plugins Info

A watermark is a text or image overlay drawn on top of a spreadsheet. The content, starting position, repeat spacing, rotation, and opacity are configurable.

The Watermark Generator previews watermark styles and downloads the plugin configuration as JSON.

Plugin mode

Installation

Shell
pnpm add @univerjs/watermark

Usage

TypeScript
import { UniverWatermarkPlugin } from '@univerjs/watermark'import '@univerjs/watermark/facade'const univer = new Univer({  // ...})univer.registerPlugin(UniverWatermarkPlugin, {   textWatermarkSettings: {     content: 'Hello, Univer!',     fontSize: 36,   }, })

Plugin configuration

Pass one of the objects below to UniverWatermarkPlugin. If more than one object is passed, user information takes precedence over text, and text takes precedence over image. The default values apply when the matching object is passed.

  • userWatermarkSettings
    object
    Watermark that displays the current user's information.
    • name
      booleanDefault: true
      Includes the current user's name.
    • email
      booleanDefault: false
      Includes the current user's email address.
    • phone
      booleanDefault: false
      Includes the current user's phone number.
    • uid
      booleanDefault: false
      Includes the current user's ID.
    • fontSize
      numberDefault: 16
      Font size in pixels.
    • color
      stringDefault: 'rgb(0,0,0)'
      Text color. Accepts a CSS color.
    • bold
      booleanDefault: false
      Uses bold text.
    • italic
      booleanDefault: false
      Uses italic text.
    • direction
      'ltr' | 'rtl' | 'inherit'Default: 'ltr'
      Sets the text direction.
    • x
      numberDefault: 60
      Initial horizontal offset in pixels.
    • y
      numberDefault: 60
      Initial vertical offset in pixels.
    • repeat
      booleanDefault: true
      Tiles the watermark across the editor.
    • spacingX
      numberDefault: 200
      Horizontal repeat spacing in pixels.
    • spacingY
      numberDefault: 100
      Vertical repeat spacing in pixels.
    • rotate
      numberDefault: -30
      Rotation in degrees.
    • opacity
      numberDefault: 0.15
      Opacity from 0 to 1.
  • textWatermarkSettings
    object
    Text watermark.
    • content
      stringDefault: ''
      Text to display.
    • fontSize
      numberDefault: 16
      Font size in pixels.
    • color
      stringDefault: 'rgb(0,0,0)'
      Text color. Accepts a CSS color.
    • bold
      booleanDefault: false
      Uses bold text.
    • italic
      booleanDefault: false
      Uses italic text.
    • direction
      'ltr' | 'rtl' | 'inherit'Default: 'ltr'
      Sets the text direction.
    • x
      numberDefault: 60
      Initial horizontal offset in pixels.
    • y
      numberDefault: 36
      Initial vertical offset in pixels.
    • repeat
      booleanDefault: true
      Tiles the watermark across the editor.
    • spacingX
      numberDefault: 200
      Horizontal repeat spacing in pixels.
    • spacingY
      numberDefault: 100
      Vertical repeat spacing in pixels.
    • rotate
      numberDefault: 0
      Rotation in degrees.
    • opacity
      numberDefault: 0.15
      Opacity from 0 to 1.
  • imageWatermarkSettings
    object
    Image watermark.
    • url
      stringDefault: ''
      URL of the watermark image.
    • width
      numberDefault: 100
      Image width in pixels.
    • height
      numberDefault: 100
      Image height in pixels when aspect ratio is unlocked.
    • maintainAspectRatio
      booleanDefault: true
      Calculates height from width and originRatio.
    • originRatio
      numberDefault: 1
      Width of the original image divided by its height.
    • x
      numberDefault: 60
      Initial horizontal offset in pixels.
    • y
      numberDefault: 36
      Initial vertical offset in pixels.
    • repeat
      booleanDefault: true
      Tiles the watermark across the editor.
    • spacingX
      numberDefault: 200
      Horizontal repeat spacing in pixels.
    • spacingY
      numberDefault: 100
      Vertical repeat spacing in pixels.
    • rotate
      numberDefault: 0
      Rotation in degrees.
    • opacity
      numberDefault: 0.15
      Opacity from 0 to 1.

IUniverWatermarkConfig

Preset mode

Watermark has no preset of its own, but the plugin still works alongside presets.

Installation

Shell
pnpm add @univerjs/watermark

Usage

TypeScript
import { UniverWatermarkPlugin } from '@univerjs/watermark'import '@univerjs/watermark/facade'const { univerAPI } = createUniver({  // ...  presets: [    UniverSheetsCorePreset(),  ],  plugins: [    [UniverWatermarkPlugin, {       textWatermarkSettings: {         content: 'Hello, Univer!',         fontSize: 36,       },     }],   ],})

Facade API

Importing

Plugin mode note

Only plugin mode requires manually importing the Facade package. Preset mode already includes the corresponding Facade package, so no additional import is required.

TypeScript
import '@univerjs/watermark/facade'

Set watermark

TypeScript
univerAPI.addWatermark('text', { content: 'hello', repeat: true })

Remove watermark

TypeScript
univerAPI.deleteWatermark()

How is this guide?

© 2026 DreamNum Co., Ltd.