Guides
Watermark
ComPDFKit_Tools provides watermark functionality, supporting both text and image watermarks.
Entry Configuration
Access watermark settings via the "watermark" item in the More menu:
json
{
"toolbarConfig": {
"availableMenus": [
"watermark"
]
}
}Watermark Configuration
Preset default watermark properties via GlobalConfig's watermarkConfig:
json
{
"global": {
"watermarkConfig": {
"watermarkType": "text",
"text": "ComPDFKit",
"textColor": "#000000",
"textColorAlpha": 128,
"fontSize": 48,
"isBold": false,
"isItalic": false,
"rotation": -45,
"opacity": 0.5,
"scale": 1.0,
"isFront": true,
"isTile": false,
"horizontalSpacing": 50,
"verticalSpacing": 50
}
}
}| Field | Description |
|---|---|
watermarkType | Watermark type: "text" or "image" |
text | Text watermark content |
textColor | Text color |
textColorAlpha | Text opacity (0-255) |
fontSize | Font size |
isBold | Whether bold |
isItalic | Whether italic |
rotation | Rotation angle (degrees) |
opacity | Overall opacity (0.0-1.0) |
scale | Scale ratio |
isFront | Whether on page foreground (true) or background (false) |
isTile | Whether to tile |
horizontalSpacing | Tile horizontal spacing |
verticalSpacing | Tile vertical spacing |
CWatermarkEditDialog
CWatermarkEditDialog is the watermark editing dialog, located in the com.compdfkit.tools.security.watermark package.
Features
- Create text watermarks
- Create image watermarks
- Real-time watermark preview
- Adjust watermark position, rotation, opacity, and other properties
- Set tile mode
Related Components
| Component | Description |
|---|---|
CWatermarkEditDialog | Watermark editing dialog |
CWatermarkTextWidget | Text watermark editing widget |
CWatermarkImageWidget | Image watermark editing widget |