PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
ComPDFKit_Tools provides watermark functionality, supporting both text and image watermarks.
Access watermark settings via the "watermark" item in the More menu:
{
"toolbarConfig": {
"availableMenus": [
"watermark"
]
}
}Preset default watermark properties via GlobalConfig's watermarkConfig:
{
"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 is the watermark editing dialog, located in the com.compdfkit.tools.security.watermark package.
| Component | Description |
|---|---|
CWatermarkEditDialog | Watermark editing dialog |
CWatermarkTextWidget | Text watermark editing widget |
CWatermarkImageWidget | Image watermark editing widget |