Type Definitions
TiledWatermark
Tiled watermark object.
- When
line1is not empty, tiled watermark is tiled text watermark. - When
picUrlis not empty, tiled watermark is tiled image watermark. - When both
line1andpicUrlare not empty, tiled watermark is tiled text watermark. - When both
line1andpicUrlare empty, tiled watermark is tiled text watermark using default configuration.
Tiled Text Watermark
| Attribute | Type | Required | Description |
|---|---|---|---|
| line1 | string | Yes | Watermark content. Default empty |
| line2 | string | No | Watermark content 2. Default empty. |
| line3 | string | No | Watermark content 3. Default empty. |
| line4 | string | No | Watermark content 4. Default empty. |
| withDate | boolean | Yes | Whether watermark includes date. Default value true. |
| font | string | Yes | Font. Default SimHei. |
| fontcolor | string | Yes | Font color. Color value is 6-digit hexadecimal color value |
| fontsize | string | Yes | Font size. Default value 16. |
| isFontBold | boolean | No | Whether watermark font is bold. Only supported when operating images, ofd. |
| isFontItalic | boolean | No | Whether watermark font is italic. Only supported when operating images, ofd |
| transparent | number | Yes | Watermark transparency. Default value 70. |
| rotation | number | Yes | Watermark tilt angle. Default value 315. |
| spacing | number | Yes | Watermark spacing. Default value 50. |
Tiled Image Watermark
| Attribute | Type | Required | Description |
|---|---|---|---|
| picUrl | string | Yes | Image download address. Download image request will set token according to tokenType and tokenValue description |
| picName | string | Yes | Image name with extension. Supports png/jpeg. |
| picScale | number | No | Image scaling ratio. When operating images, parameter value range is (0-200) |
| transparent | number | Yes | Watermark transparency When operating images, parameter value range is (0-100) |
| rotation | number | Yes | Rotation angle. |
| spacing | number | Yes | Image spacing. |
TextWatermark
Position text watermark
| Attribute | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | Watermark content |
| fontcolor | string | Yes | Font color. Color value is 6-digit hexadecimal color value |
| fontsize | string | Yes | Font size. Value range [1, 72], larger value means larger watermark. ofd format default 16 |
| font | string | Yes | Font. |
| isFontBold | boolean | No | Whether watermark font is bold. Only supported when operating images, ofd. |
| isFontItalic | boolean | No | Whether watermark font is italic. Only supported when operating images, ofd |
| transparent | number | No | Watermark transparency, value range [0, 100] |
| rotation | number | No | Rotation angle |
| position | enum | No | Watermark position, parameter description see Type/WatermarkPosition |
MsPicWatermark
Position image watermark
| Attribute | Type | Required | Description |
|---|---|---|---|
| picUrl | string | Yes | Image download address. Download image request will set token according to tokenType and tokenValue description |
| picName | string | Yes | Image name with extension. Supports jpg/jpeg/png/bmp Source file type docx/wps/doc only supports jpg/png |
| picScale | number | No | Image scaling ratio (0-200) Source file type docx/wps/doc supports range [50, 500] |
| isErosion | boolean | No | Whether there is erosion effect, default false Only supported when source file type is docx/wps/doc |
| transparent | number | No | Watermark transparency (0-100). Source file type docx/wps/doc does not support |
| rotation | number | No | Image rotation angle. |
| position | enum | No | Watermark position, default CENTER, parameter description see Type/WatermarkPosition |
| widthInCm | number | No | Image width, unit cm Only supported when source file type is docx/wps/doc |
| heightInCm | number | No | Image height, unit cm Only supported when source file type is docx/wps/doc |
WatermarkPosition
Watermark position enum
| Value | Description |
|---|---|
| TOP_LEFT | Top left |
| TOP_CENTER | Top center |
| TOP_RIGHT | Top right |
| CENTER_LEFT | Center left |
| CENTER | Center |
| CENTER_RIGHT | Center right |
| BOTTOM_LEFT | Bottom left |
| BOTTOM_CENTER | Bottom center |
| BOTTOM_RIGHT | Bottom right |
toPicOptions
| Attribute | Option Type | Required | Description |
|---|---|---|---|
| start | number | No | Conversion starting page, counting from 1, controls output range. |
| end | number | No | Conversion ending page, end needs to be greater than or equal to start, (if start and end are not passed, default is convert all) |
| longPicType | enum | No | Stitch 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. |