當前位置: 首頁>>代碼示例>>C#>>正文


C# Document.AppendVerticalSpace方法代碼示例

本文整理匯總了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);
        }
開發者ID:cgavieta,項目名稱:WORKPAC2016-poc,代碼行數:31,代碼來源:PdfWriter.cs


注:本文中的MigraDoc.DocumentObjectModel.Document.AppendVerticalSpace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。