iTextSharp.text.Font.SetStyle C# (CSharp) Метод

SetStyle() публичный Метод

public SetStyle ( int style ) : void
style int
Результат void
        public virtual void SetStyle(int style) {
            this.style = style;
        }
            

Same methods

Font::SetStyle ( String style ) : void

Usage Example

Пример #1
0
        private static void addCell(PdfPTable table, string text, int rowspan, string fontStyle)
        {
            BaseFont bfTimes = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, false);

            iTextSharp.text.Font fuente = new iTextSharp.text.Font(bfTimes, 8, iTextSharp.text.Font.NORMAL, iTextSharp.text.BaseColor.BLACK);

            if (fontStyle.ToLower() == "n")
            {
                fuente.SetStyle(Font.NORMAL);
            }
            else if (fontStyle.ToLower() == "b")
            {
                fuente.SetStyle(Font.BOLD);
            }
            else if (fontStyle.ToLower() == "i")
            {
                fuente.SetStyle(Font.ITALIC);
            }

            PdfPCell cell = new PdfPCell(new Phrase(text, fuente));

            cell.BorderWidth         = 0;
            cell.Rowspan             = rowspan;
            cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            table.AddCell(cell);
        }
All Usage Examples Of iTextSharp.text.Font::SetStyle