Watermark
Plugins Info
@univerjs/watermark
Server Required
No
Watermark feature aims to provide a flexible and secure watermark solution for spreadsheets. It allows developers to add text or image watermarks to spreadsheets and offers various configuration options to customize the appearance and behavior of the watermark.
Preset Mode
Watermark does not provide a preset, but it supports mixing with its plugins.
Installation
npm install @univerjs/watermark
Usage
import { UniverWatermarkPlugin } from '@univerjs/watermark'
import '@univerjs/watermark/facade'
import '@univerjs/watermark/lib/index.css'
const { univerAPI } = createUniver({
// ...
presets: [
UniverSheetsCorePreset(),
],
plugins: [
[UniverWatermarkPlugin, {
textWatermarkSettings: {
content: 'Hello, Univer!',
fontSize: 36,
},
}],
],
})
Plugin Mode
Installation
npm install @univerjs/watermark
Usage
import { UniverWatermarkPlugin } from '@univerjs/watermark'
import '@univerjs/watermark/facade'
import '@univerjs/watermark/lib/index.css'
const univer = new Univer({
// ...
})
univer.registerPlugin(UniverWatermarkPlugin, {
textWatermarkSettings: {
content: 'Hello, Univer!',
fontSize: 36,
},
})
Plugins and Configuration
@univerjs/watermark
This plugin provides the core implementation of watermark functionality. It allows developers to add text or image watermarks to applications and offers various configuration options to customize the appearance and behavior of the watermark. It provides the UniverWatermarkPlugin
plugin.
Reference: @univerjs/watermark
Facade API
Set Watermark
univerAPI.addWatermark('text', { content: 'hello', repeat: true })
Remove Watermark
univerAPI.removeWatermark()