示例#1
0
 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;
 }
示例#2
0
        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);
        }