本文整理汇总了C#中MigraDoc.DocumentObjectModel.Document.AppendVerticalSpace方法的典型用法代码示例。如果您正苦于以下问题:C# Document.AppendVerticalSpace方法的具体用法?C# Document.AppendVerticalSpace怎么用?C# Document.AppendVerticalSpace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MigraDoc.DocumentObjectModel.Document
的用法示例。
在下文中一共展示了Document.AppendVerticalSpace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteHeader
/// <summary>
/// Adds a header to <paramref name="document"/>.
/// </summary>
/// <param name="document">A <see cref="MigraDoc.DocumentObjectModel.Document"/> to add a header to.</param>
/// <param name="title">The document title.</param>
/// <param name="logoUri">The URI of the logo file.</param>
protected void WriteHeader(Document document, string title, string logoUri)
{
TextFrame frame = document.LastSection.AddTextFrame();
Paragraph paragraph = frame.AddParagraph(title ?? string.Empty);
paragraph.Style = StyleNames.Header;
frame.Left = ShapePosition.Left;
frame.RelativeVertical = RelativeVertical.Page;
frame.Top = new Unit(15, UnitType.Millimeter);
frame.RelativeVertical = RelativeVertical.Page;
frame.Width = new Unit(14, UnitType.Centimeter);
Unit imageHeight = new Unit(25, UnitType.Millimeter);
if (!string.IsNullOrEmpty(logoUri))
{
Image image1 = document.LastSection.AddImage(logoUri);
image1.Left = ShapePosition.Right;
image1.RelativeVertical = RelativeVertical.Page;
image1.Top = new Unit(15, UnitType.Millimeter);
image1.RelativeVertical = RelativeVertical.Page;
image1.Height = imageHeight;
image1.LockAspectRatio = true;
}
document.AppendVerticalSpace(imageHeight);
}