iTextSharp.text.Cell.SetHorizontalAlignment C# (CSharp) 메소드

SetHorizontalAlignment() 공개 메소드

Sets the alignment of this cell.
public SetHorizontalAlignment ( string alignment ) : void
alignment string the new alignment as a string
리턴 void
        public void SetHorizontalAlignment(string alignment) {
            if (Util.EqualsIgnoreCase(alignment, ElementTags.ALIGN_CENTER)) {
                this.HorizontalAlignment = Element.ALIGN_CENTER;
                return;
            }
            if (Util.EqualsIgnoreCase(alignment, ElementTags.ALIGN_RIGHT)) {
                this.HorizontalAlignment = Element.ALIGN_RIGHT;
                return;
            }
            if (Util.EqualsIgnoreCase(alignment, ElementTags.ALIGN_JUSTIFIED)) {
                this.HorizontalAlignment = Element.ALIGN_JUSTIFIED;
                return;
            }
            if (Util.EqualsIgnoreCase(alignment, ElementTags.ALIGN_JUSTIFIED_ALL)) {
                this.HorizontalAlignment = Element.ALIGN_JUSTIFIED_ALL;
                return;
            }
            this.HorizontalAlignment = Element.ALIGN_LEFT;
        }

Usage Example

예제 #1
0
        public static Cell GetCell(Properties attributes)
        {
            Cell cell = new Cell();
            String value;

            cell.SetHorizontalAlignment(attributes[ElementTags.HORIZONTALALIGN]);
            cell.SetVerticalAlignment(attributes[ElementTags.VERTICALALIGN]);
            value = attributes[ElementTags.WIDTH];
            if (value != null) {
                cell.SetWidth(value);
            }
            value = attributes[ElementTags.COLSPAN];
            if (value != null) {
                cell.Colspan = int.Parse(value);
            }
            value = attributes[ElementTags.ROWSPAN];
            if (value != null) {
                cell.Rowspan = int.Parse(value);
            }
            value = attributes[ElementTags.LEADING];
            if (value != null) {
                cell.Leading = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            cell.Header = Utilities.CheckTrueOrFalse(attributes, ElementTags.HEADER);
            if (Utilities.CheckTrueOrFalse(attributes, ElementTags.NOWRAP)) {
                cell.MaxLines = 1;
            }
            SetRectangleProperties(cell, attributes);
            return cell;
        }
All Usage Examples Of iTextSharp.text.Cell::SetHorizontalAlignment