Skip to main content

Type Definitions

TiledWatermark

Tiled watermark object.

  • When line1 is not empty, tiled watermark is tiled text watermark.
  • When picUrl is not empty, tiled watermark is tiled image watermark.
  • When both line1 and picUrl are not empty, tiled watermark is tiled text watermark.
  • When both line1 and picUrl are empty, tiled watermark is tiled text watermark using default configuration.

Tiled Text Watermark

AttributeTypeRequiredDescription
line1stringYesWatermark content. Default empty
line2stringNoWatermark content 2. Default empty.
line3stringNoWatermark content 3. Default empty.
line4stringNoWatermark content 4. Default empty.
withDatebooleanYesWhether watermark includes date. Default value true.
fontstringYesFont. Default SimHei.
fontcolorstringYesFont color. Color value is 6-digit hexadecimal color value
fontsizestringYesFont size. Default value 16.
isFontBoldbooleanNoWhether watermark font is bold. Only supported when operating images, ofd.
isFontItalicbooleanNoWhether watermark font is italic. Only supported when operating images, ofd
transparentnumberYesWatermark transparency. Default value 70.
rotationnumberYesWatermark tilt angle. Default value 315.
spacingnumberYesWatermark spacing. Default value 50.

Tiled Image Watermark

AttributeTypeRequiredDescription
picUrlstringYesImage download address. Download image request will set token according to tokenType and tokenValue description
picNamestringYesImage name with extension. Supports png/jpeg.
picScalenumberNoImage scaling ratio. When operating images, parameter value range is (0-200)
transparentnumberYesWatermark transparency When operating images, parameter value range is (0-100)
rotationnumberYesRotation angle.
spacingnumberYesImage spacing.

TextWatermark

Position text watermark

AttributeTypeRequiredDescription
textstringYesWatermark content
fontcolorstringYesFont color. Color value is 6-digit hexadecimal color value
fontsizestringYesFont size. Value range [1, 72], larger value means larger watermark. ofd format default 16
fontstringYesFont.
isFontBoldbooleanNoWhether watermark font is bold. Only supported when operating images, ofd.
isFontItalicbooleanNoWhether watermark font is italic. Only supported when operating images, ofd
transparentnumberNoWatermark transparency, value range [0, 100]
rotationnumberNoRotation angle
positionenumNoWatermark position, parameter description see Type/WatermarkPosition

MsPicWatermark

Position image watermark

AttributeTypeRequiredDescription
picUrlstringYesImage download address. Download image request will set token according to tokenType and tokenValue description
picNamestringYesImage name with extension. Supports jpg/jpeg/png/bmp Source file type docx/wps/doc only supports jpg/png
picScalenumberNoImage scaling ratio (0-200) Source file type docx/wps/doc supports range [50, 500]
isErosionbooleanNoWhether there is erosion effect, default false Only supported when source file type is docx/wps/doc
transparentnumberNoWatermark transparency (0-100). Source file type docx/wps/doc does not support
rotationnumberNoImage rotation angle.
positionenumNoWatermark position, default CENTER, parameter description see Type/WatermarkPosition
widthInCmnumberNoImage width, unit cm Only supported when source file type is docx/wps/doc
heightInCmnumberNoImage height, unit cm Only supported when source file type is docx/wps/doc

WatermarkPosition

Watermark position enum

ValueDescription
TOP_LEFTTop left
TOP_CENTERTop center
TOP_RIGHTTop right
CENTER_LEFTCenter left
CENTERCenter
CENTER_RIGHTCenter right
BOTTOM_LEFTBottom left
BOTTOM_CENTERBottom center
BOTTOM_RIGHTBottom right

toPicOptions

AttributeOption TypeRequiredDescription
startnumberNoConversion starting page, counting from 1, controls output range.
endnumberNoConversion ending page, end needs to be greater than or equal to start, (if start and end are not passed, default is convert all)
longPicTypeenumNoStitch images after conversion, stitching method (optional values: MD/TD) (vertical/horizontal), if not passed default is no stitching. Word to image does not support stitching.