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


C# Paragraph.SetAlignment方法代碼示例

本文整理匯總了C#中iTextSharp.text.Paragraph.SetAlignment方法的典型用法代碼示例。如果您正苦於以下問題:C# Paragraph.SetAlignment方法的具體用法?C# Paragraph.SetAlignment怎麽用?C# Paragraph.SetAlignment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在iTextSharp.text.Paragraph的用法示例。


在下文中一共展示了Paragraph.SetAlignment方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetParagraph

 public static Paragraph GetParagraph(Properties attributes)
 {
     Paragraph paragraph = new Paragraph(GetPhrase(attributes));
     String value;
     value = attributes[ElementTags.ALIGN];
     if (value != null) {
         paragraph.SetAlignment(value);
     }
     value = attributes[ElementTags.INDENTATIONLEFT];
     if (value != null) {
         paragraph.IndentationLeft = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     value = attributes[ElementTags.INDENTATIONRIGHT];
     if (value != null) {
         paragraph.IndentationRight = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     return paragraph;
 }
開發者ID:bmictech,項目名稱:iTextSharp,代碼行數:18,代碼來源:ElementFactory.cs

示例2: OnStartPage

        public override void OnStartPage(PdfWriter writer, Document document)
        {
            if (!_isDocumentClosing) {

                _pageNumber++;

                // ===========================================================================
                // Create header column -- in this report this is the page's column object
                // ===========================================================================
                ct.SetSimpleColumn(PortraitPageSize.HdrLowerLeftX, PortraitPageSize.HdrLowerLeftY,
                    PortraitPageSize.HdrUpperRightX, PortraitPageSize.HdrUpperRightY,
                    PortraitPageSize.PgLeading, Element.ALIGN_CENTER);
                ct.YLine = PortraitPageSize.HdrTopYLine;

                // =======================================================
                // Add Logo
                // =======================================================
                if (_pageNumber == 1) {

                    float[] wscLogoLayout = new float[] { 413F, 127F };
                    PdfPTable logoTable = PdfReports.CreateTable(wscLogoLayout, 0);
                    PdfReports.AddText2Table(logoTable, " ", normalFont);

                    PdfReports.AddImage2Table(logoTable, _imgLogo);
                    PdfReports.AddText2Table(logoTable, " ", titleFont, wscLogoLayout.Length);
                    PdfReports.AddTableNoSplit(document, this, logoTable);
                }

                float[] headerLayout = new float[] { 50F, 490F };
                PdfPTable table = PdfReports.CreateTable(headerLayout, 1);

                Paragraph p = new Paragraph(_title, titleFont);
                p.SetAlignment("center");

                PdfReports.AddText2Table(table, p, "center", headerLayout.Length);

                // Add blank lines
                PdfReports.AddText2Table(table, " ", subNormalFont, headerLayout.Length);
                PdfReports.AddText2Table(table, " ", normalFont, headerLayout.Length);

                // Add Header information
                PdfReports.AddText2Table(table, "SHID", labelFont);
                PdfReports.AddText2Table(table, "Shareholder Name", labelFont);

                PdfReports.AddText2Table(table, _shid, normalFont);
                PdfReports.AddText2Table(table, _shareholderName, normalFont);

                PdfReports.AddText2Table(table, " ", normalFont, headerLayout.Length);
                PdfReports.AddText2Table(table, " ", normalFont, headerLayout.Length);

                PdfReports.AddTableNoSplit(document, this, table);

                table = PdfReports.CreateTable(_primaryTableLayout, 0);
                AddDetailSectionHdr(ref table, labelFont, normalFont);
                PdfReports.AddTableNoSplit(document, this, table);

                _headerBottomYLine = ct.YLine;
            }

            base.OnStartPage(writer, document);
        }
開發者ID:jwebb-vtg,項目名稱:WSCIEMP,代碼行數:61,代碼來源:rptContractSummary.cs


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