本文整理汇总了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);)
}