Skip to content

Watermark

Used to Add a watermark to a specified area.

Basic usage

Basic usage of the watermark.

Multiline text

Multi-line text watermarks can be specified with the content set string array.

Image watermark

Set an image watermark using the image property. To ensure that the image is high definition and not stretched, set the width and height, and upload at least twice the width and height of the logo image address. (supports Base64).

Custom

Customize the watermark.

Watermark API

Watermark Attributes

NameDescriptionTypeDefault
contentWatermark text contentString Object-
imgageImage watermark addressString-
widthWatermark widthNumber-
heightWatermark heightNumber-
gapWatermark spacingObject[90,90]
offsetThe offset from the upper left corner of the container, the default is half the watermark spacingObject[gap[0]/2, gap[1]/2]
rotateWatermark rotation angleNumber-22
fontWatermark font styleFontFont
z-indexWatermark z-indexNumber6
alphaWatermark opacityNumber1
anti-tamperWatermark anti-tamperingBooleantrue
grayscaleGrayscale watermarkBooleanfalse
repeatWhether to repeat the watermarkBooleantrue
staggeredWhether to stagger the arrangement layoutBooleantrue

Font

NameDescriptionTypeDefault
colorFont colorStringrgba(128, 128, 128, 0.18)
fontSizeFont sizeNumber16
fontFamilyFont familyStringMicrosoft YaHei
fontStyleFont styleStringnormal
textAlignFont alignStringcenter
fontWeightFont weightStringlighter