当前位置: 首页>>代码示例>>C#>>正文


C# DocumentBuilder.InsertSignatureLine方法代码示例

本文整理汇总了C#中DocumentBuilder.InsertSignatureLine方法的典型用法代码示例。如果您正苦于以下问题:C# DocumentBuilder.InsertSignatureLine方法的具体用法?C# DocumentBuilder.InsertSignatureLine怎么用?C# DocumentBuilder.InsertSignatureLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DocumentBuilder的用法示例。


在下文中一共展示了DocumentBuilder.InsertSignatureLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InsertSignatureLineCurrentPozition

        public void InsertSignatureLineCurrentPozition()
        {
            //ExStart
            //ExFor:SignatureLine
            //ExFor:SignatureLineOptions
            //ExFor:DocumentBuilder.InsertSignatureLine(SignatureLineOptions)
            //ExFor:DocumentBuilder.InsertSignatureLine(SignatureLineOptions)
            //ExSummary:Shows how to insert signature line and get signature line properties
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            SignatureLineOptions options = new SignatureLineOptions();
            options.Signer = "John Doe";
            options.SignerTitle = "Manager";
            options.Email = "[email protected]";
            options.ShowDate = true;
            options.DefaultInstructions = false;
            options.Instructions = "You need more info about signature line";
            options.AllowComments = true;

            builder.InsertSignatureLine(options);
            builder.InsertSignatureLine(options, RelativeHorizontalPosition.RightMargin, 2.0, RelativeVerticalPosition.Page, 3.0, WrapType.Inline);
            
            MemoryStream dstStream = new MemoryStream();
            doc.Save(dstStream, SaveFormat.Docx);

            Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
            SignatureLine signatureLine = shape.SignatureLine;

            Assert.AreEqual("John Doe", signatureLine.Signer);
            Assert.AreEqual("Manager", signatureLine.SignerTitle);
            Assert.AreEqual("[email protected]", signatureLine.Email);
            Assert.AreEqual(true, signatureLine.ShowDate);
            Assert.AreEqual(false, signatureLine.DefaultInstructions);
            Assert.AreEqual("You need more info about signature line", signatureLine.Instructions);
            Assert.AreEqual(true, signatureLine.AllowComments);
            Assert.AreEqual(false, signatureLine.IsSigned);
            Assert.AreEqual(false, signatureLine.IsValid);
            //ExEnd

            shape = (Shape)doc.GetChild(NodeType.Shape, 1, true);
            Assert.AreEqual(RelativeHorizontalPosition.RightMargin, shape.RelativeHorizontalPosition);
            Assert.AreEqual(2.0, shape.Left);
            Assert.AreEqual(RelativeVerticalPosition.Page, shape.RelativeVerticalPosition);
            Assert.AreEqual(3.0, shape.Top);
            Assert.AreEqual(WrapType.Inline, shape.WrapType);
            //Bug: If wraptype are not inline shape break his position (builder.InsertSignatureLine(options, RelativeHorizontalPosition.RightMargin, 2.0, RelativeVerticalPosition.Page, 3.0, WrapType.Inline);)
        }
开发者ID:aspose-words,项目名称:Aspose.Words-for-.NET,代码行数:48,代码来源:ExDocumentBuilder.cs


注:本文中的DocumentBuilder.InsertSignatureLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。