急求JSP在word中第二页及其之后加水印,怎么加????

流星陨落 流星陨落 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
如题,我在网上找的代码可以加上水印,但全加上了,求在第二页之后加水印的方法,最好有源码
这是我的代码:
<script>	
<%
String isPrintText = request.getParameter("isPrintText"); //是否添加水印
%>
var global_init = true;
var isPrintText = '<%=isPrintText%>';
var nowdate = new Date().getYear() + "-" + (new Date().getMonth()+1) + "-" + new Date().getDate() + " " + new Date().getHours() + ":" + new Date().getMinutes();

function fn_onloadWord(){
if("true"==isPrintText){
var OfficeOCX = document.all.wordcomponent.contentWindow.v_egov_Word_OCX;
OfficeOCX.SetReadOnly(false, "" );
var ActiveDocument = OfficeOCX.ActiveDocument;
OfficeOCX.ActiveDocument.Application.ScreenUpdating = false;
OfficeOCX.ActiveDocument.Sections(1).Range.Select();
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = 9;
ActiveDocument.Application.Selection.HeaderFooter.Shapes.AddTextEffect(0, "公司绝密"+top.SSF_LUSER.orgOrgName+"\r"+top.SSF_LUSER.orgDepName+top.SSF_LUSER.userName+nowdate, "华文新魏", 90, false, false, 0, 0).Select();
ActiveDocument.Application.Selection.ShapeRange.TextEffect.NormalizedHeight = false;
ActiveDocument.Application.Selection.ShapeRange.Line.Visible = false;
ActiveDocument.Application.Selection.ShapeRange.Fill.Visible = true;
ActiveDocument.Application.Selection.ShapeRange.Fill.Solid();
ActiveDocument.Application.Selection.ShapeRange.Fill.ForeColor.RGB =12632256;
ActiveDocument.Application.Selection.ShapeRange.Fill.Transparency = 0.5;
//ActiveDocument.Application.Selection.ShapeRange.Rotation = 0;//控制平行
ActiveDocument.Application.Selection.ShapeRange.LockAspectRatio = true;
ActiveDocument.Application.Selection.ShapeRange.Height = 4.58 * 28.346;
ActiveDocument.Application.Selection.ShapeRange.Width = 28.07 * 28.346;
ActiveDocument.Application.Selection.ShapeRange.Rotation = 305; //控制旋转
ActiveDocument.Application.Selection.ShapeRange.WrapFormat.AllowOverlap = true;
ActiveDocument.Application.Selection.ShapeRange.WrapFormat.Side = 3;
ActiveDocument.Application.Selection.ShapeRange.WrapFormat.Type = 3;
ActiveDocument.Application.Selection.ShapeRange.RelativeHorizontalPosition =0;
ActiveDocument.Application.Selection.ShapeRange.RelativeVerticalPosition = 0;
ActiveDocument.Application.Selection.ShapeRange.Left = -999995;
ActiveDocument.Application.Selection.ShapeRange.Top = -999995;
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = 0;
OfficeOCX.ActiveDocument.Application.ScreenUpdating = true;
OfficeOCX.SetReadOnly(true, "" );
}
}
</script>


急求!!!
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
流星陨落
Web 开发 81,108 成员 341,721 内容