public class Watermark extends Object implements WatermarkComponent
Copyright (c) 2020 xsx All Rights Reserved. x-easypdf-fop is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.
Constructor and Description |
---|
Watermark() |
public Watermark setTempDir(String tempDir)
tempDir
- 临时目录public Watermark setWidth(String width)
width
- 图像宽度public Watermark setHeight(String height)
height
- 图像高度public Watermark setShowWidth(String width)
width
- 图像显示宽度public Watermark setShowHeight(String height)
height
- 图像显示高度public Watermark setFontFamily(String fontFamily)
fontFamily
- 字体名称public Watermark setFontStyle(String fontStyle)
normal:正常
oblique:斜体
italic:斜体
backslant:斜体
fontStyle
- 字体样式public Watermark setFontSize(String fontSize)
fontSize
- 字体大小public Watermark setFontColor(String color)
color:颜色(名称或16进制颜色)
transparent:透明
color
- 字体颜色public Watermark setFontAlpha(String alpha)
0-255之间,值越小越透明
alpha
- 字体透明度public Watermark setPosition(String position)
第一个参数为X轴
第二个参数为Y轴
position
- 定位public Watermark setHorizontalPosition(String position)
position
- 定位public Watermark setVerticalPosition(String position)
position
- 定位public Watermark setRepeat(String repeat)
repeat:水平垂直重复
repeat-x:水平重复
repeat-y:垂直重复
no-repeat:不重复
repeat
- 重复public Watermark setRadians(String radians)
radians
- 旋转弧度public Watermark enableOverwrite()
public Watermark setText(String... texts)
texts
- 文本列表public Watermark setText(List<String> texts)
texts
- 文本列表public void saveImage()
public void createWatermark(Document document, Element element)
createWatermark
in interface WatermarkComponent
document
- fo文档element
- fo元素Copyright © 2024. All rights reserved.