Esempio n. 1
0
        private static PdfGrid createHeader(PagesHeaderBuilder header)
        {
            var table = new PdfGrid(numColumns: 1)
            {
                WidthPercentage = 100,
                RunDirection    = PdfWriter.RUN_DIRECTION_LTR,
                SpacingAfter    = 7
            };

            var title   = header.PdfFont.FontSelector.Process("Our new rpt.");
            var pdfCell = new PdfPCell(title)
            {
                RunDirection        = PdfWriter.RUN_DIRECTION_LTR,
                BorderWidthLeft     = 0,
                BorderWidthRight    = 0,
                BorderWidthTop      = 0,
                BorderWidthBottom   = 1,
                Padding             = 4,
                BorderColorBottom   = new BaseColor(System.Drawing.Color.LightGray),
                HorizontalAlignment = Element.ALIGN_CENTER
            };

            table.AddCell(pdfCell);
            return(table);
        }
Esempio n. 2
0
        private static PdfGrid createHeader(PagesHeaderBuilder header)
        {
            var table = new PdfGrid(numColumns: 1)
            {
                WidthPercentage = 100,
                RunDirection    = PdfWriter.RUN_DIRECTION_RTL,
                SpacingAfter    = 7
            };

            var          basefont = BaseFont.CreateFont(TestUtils.GetTahomaFontPath(), BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
            var          gillsans = new iTextSharp.text.Font(basefont, 30, iTextSharp.text.Font.BOLD, new BaseColor(ColorTranslator.FromHtml("#009cde").ToArgb()));
            FontSelector selector = new FontSelector();

            selector.AddFont(gillsans);
            var title = selector.Process("PayPing");

            var pdfCell = new PdfPCell(title)
            {
                RunDirection        = PdfWriter.RUN_DIRECTION_RTL,
                BorderWidthLeft     = 0,
                BorderWidthRight    = 0,
                BorderWidthTop      = 0,
                BorderWidthBottom   = 1,
                PaddingBottom       = 10,
                BorderColorBottom   = new BaseColor(System.Drawing.Color.LightGray.ToArgb()),
                HorizontalAlignment = Element.ALIGN_CENTER
            };

            table.AddCell(pdfCell);
            return(table);
        }