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