code = new Code();
code.("隶书");
code.("c:\\\\fonts\\SIMLI.TTF");
.add(code);
;
}
/**
* 水印常用字号
*
* @ List
*/
List () {
List= new ();
.add(new Code("9", "9"));
.add(new Code("12", "12"));
.add(new Code("14", "14"));
.add(new Code("16", "16"));
.add(new Code("20", "20"));
.add(new Code("30", "30"));
.add(new Code("40", "40"));
.add(new Code("50", "50"));
.add(new Code("60", "60"));
.add(new Code("70", "70"));
.add(new Code("80", "80"));
.add(new Code("90", "90"));
.add(new Code("100", "100"));
;
}
/**
* 水印旋转角度 -90到90
*
* @ List
*/
List () {
List= new ();
.add(new Code("0", "0"));
.add(new Code("30", "30"));
.add(new Code("45", "45"));
.add(new Code("60", "60"));
.add(new Code("90", "90"));
.add(new Code("120", "120"));
.add(new Code("135", "135"));
.add(new Code("150", "150"));
.add(new Code("180", "180"));
;
}
/**
* pdf水印透明度 0.1-1.0数值越大,越清晰
*
文章插图
* @ List
*/
List () {
List= new ();
.add(new Code("0.1", "0.1"));
.add(new Code("0.2", "0.2"));
.add(new Code("0.3", "0.3"));
.add(new Code("0.4", "0.4"));
.add(new Code("0.5", "0.5"));
.add(new Code("0.6", "0.6"));
.add(new Code("0.7", "0.7"));
.add(new Code("0.8", "0.8"));
.add(new Code("0.9", "0.9"));
.add(new Code("1", "1"));
;
}
/**
* word水印透明度 0->1,数值越小,越清晰
*
* @ List
*/
List () {
List= new ();
.add(new Code("0.9", "0.1"));
.add(new Code("0.8", "0.2"));
.add(new Code("0.7", "0.3"));
.add(new Code("0.6", "0.4"));
.add(new Code("0.5", "0.5"));
.add(new Code("0.4", "0.6"));
.add(new Code("0.3", "0.7"));
.add(new Code("0.2", "0.8"));
.add(new Code("0.1", "0.9"));
.add(new Code("0", "1"));
;
}
/**
* 用户自定义水印页码范围备用选项
*
* @ List
*/
List () {
List= new ();
.add(new Code("", "全部页"));
.add(new Code("", "奇数页"));
.add(new Code("", "偶数页"));
.add(new Code("", "仅首页"));
.add(new Code("", "非首页"));
;
}
(List ,, )
,{
bean = new ();
// pdf文件上传
= new ();
= e.();
= .();
= .();
// 文件上传后的文件路径
path = .(.(), "", "file", .g(),
) + .nval(, "." + );
.();
.();
.("pdf");
bean.();
// 要输出的pdf文件(加完水印后的)
= .(.(), "", "pdf",
.g());
= .(.(), "", "pdf",
.g(), ) + .nval(, "." + );
File= new File();
// 判断是否存在该路径,不存在则创建新文件路径(文件夹)
if (!.()) {
.();
}
bos = new (new (new File()));
// 1.处理pdf文件
// 读取未处理的pdf文件
= new (path);
= new (, bos);
for (:) {
// word图片ID
= "";
if(.(.(), "true") || .(.(), "on")){
if ( != null) {
imgId = e.();
= .();
= .();
// 文件上传后的文件路径
= .(.(), "", "file", .g(),
imgId) + .nval(, "." + );
} else {
// 历史记录选择回显的case,路径为历史文件
imgId = .();
= .();
= .();
// 文件上传后的文件路径
= .(.(), "", "file", .(),
imgId) + .nval(, "." + );
}
}
// 获取pdf文件的页码
【PDF、WORD文档在线添加水印源码】int total = .() + 1;
- 紫乐多肉怎么养
- 圆葱的种植方法和生长时间
- 甘蔗渣可以用来养花吗
- 七彩龙血树的养殖方法和注意事项
- 豌豆尖的种植方法和时间
- 桃树叶卷曲是什么病,打什么药
- 热带雨林有什么树
- 无花果插枝种植方法
- 皇帝菜怎么种
- 果汁阳台怎么修剪