I am using the following code the put text into a table cell and to then align the text in the middle of the cell. The Horizontal Alignment works but the Vertical doesn't.
Can anyone tell me where i'm going wrong please.
Dim c As New Cell
Dim font As com.lowagie.text.Font
font = FontFactory.getFont(FontFactory.COURIER, cell.FontSize, com.lowagie.text.Font.NORMAL)
Dim p As New Phrase("test", font)
c.setVerticalAlignment(Element.ALIGN_MIDDLE)
c.setHorizontalAlignment(Element.ALIGN_CENTER)
c.addElement(p)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using the following code the put text into a table cell and to then align the text in the middle of the cell. The Horizontal Alignment works but the Vertical doesn't.
Can anyone tell me where i'm going wrong please.
Dim c As New Cell
Dim font As com.lowagie.text.Font
font = FontFactory.getFont(FontFactory.COURIER, cell.FontSize, com.lowagie.text.Font.NORMAL)
Dim p As New Phrase("test", font)
c.setVerticalAlignment(Element.ALIGN_MIDDLE)
c.setHorizontalAlignment(Element.ALIGN_CENTER)
c.addElement(p)
See example code.
http://www.ujihara.jp/iTextdotNET/examples/Chap0506.cs