本技术资料版权所有,禁止分发.©(2003-2007),重庆软航科技有限公司,保留所有权利.NTKO和软航是软航科技的商标

NTKO OFFICE文档控件技术资料

linux环境下使用文档控件添加文字水印的解决办法


创建时间:06/29/2021 05:39:29 PM 修改时间: 06/29/2021 05:43:53 PM
分类:BS开发-常见问题, BS开发-开发入门及架构, BS开发-开发技巧, BS客户端-JavaScript控制Word, BS客户端-JavaScript控制Excel, BS后台开发-Domino平台, BS后台开发-JSP,J2EE开发, BS后台开发-C#.NET,VB.NET, BS后台开发-PHP开发, BS后台开发-ASP开发, CS应用开发-VC,PB,VB, CS应用开发-C#.NET,VB.NET,Delphi
适应版本号:7.0; 6,0

相关文档:本文档没有相关文档

与windows上的主要区别是AddTextEffect的方法参数,布尔值用0或1来代替
          function addWaterMark(text)
          {
          try
          {
          var ActiveDocument = oframe.ActiveDocument;

          for (i=1;i<=ActiveDocument.Sections.Count ; i++)
          {
          ActiveDocument.Sections.item(i).Range.Select();
          ActiveDocument.ActiveWindow.ActivePane.View.SeekView = 9; //wdSeekCurrentPageHeader
          var Selection = ActiveDocument.Application.Selection;
          Selection.HeaderFooter.Shapes.AddTextEffect(0, text, "宋体", 1, 0, 0, 0, 0).Select();
          Selection.ShapeRange.TextEffect.NormalizedHeight = false;
          Selection.ShapeRange.Line.Visible = false;
          Selection.ShapeRange.Fill.Visible = true;
          Selection.ShapeRange.Fill.Solid();
          Selection.ShapeRange.Fill.ForeColor.RGB = 12345;
          Selection.ShapeRange.Fill.Transparency = 0.5;
          Selection.ShapeRange.Rotation = 315;
          Selection.ShapeRange.LockAspectRatio = true;
          Selection.ShapeRange.Height = ActiveDocument.Application.CentimetersToPoints(4.13);
          Selection.ShapeRange.Width = ActiveDocument.Application.CentimetersToPoints(16.52);
          Selection.ShapeRange.WrapFormat.AllowOverlap = true;
          Selection.ShapeRange.WrapFormat.Side = 3;//wdWrapNone
          Selection.ShapeRange.WrapFormat.Type = 3;
          Selection.ShapeRange.RelativeHorizontalPosition = 0;//wdRelativeVerticalPositionMargin
          Selection.ShapeRange.RelativeVerticalPosition = 0; //wdRelativeVerticalPositionMargin
          Selection.ShapeRange.Left = -999995; //wdShapeCenter
          Selection.ShapeRange.Top = -999995; //wdShapeCenter
          ActiveDocument.ActiveWindow.ActivePane.View.SeekView = 0;//wdSeekMainDocument
          }
          }
          catch(err){
          alert("addWaterMark errir:" + err.number + ":" + err.description);
          }
          }

返回页面顶部↑  
本文档的相关文档:
本文档没有相关文档