I tried
BaseFont bf = BaseFont.createFont(fields[i].getFontFilename(), BaseFont.WINANSI, true);
Font font = new Font(bf, fields[i].getFontSize(), fields[i].getFontStyle());
Phrase ph = new Phrase(data.getFieldValue(fields[i].getFieldname()), font);
PdfPCell cell = new PdfPCell(ph);
cell.setVerticalAlignment(PdfPCell.ALIGN_BOTTOM);
cell.setHorizontalAlignment(fields[i].getHorizontalAlignment());
cell.setFixedHeight(fields[i].getHeight());
//cell.setBorder(PdfPCell.NO_BORDER);
cell.setNoWrap(!fields[i].isTextWrap());
PdfPTable tbl = new PdfPTable(1);
tbl.addCell(cell);
tbl.setTotalWidth(fields[i].getWidth());
tbl.writeSelectedRows(0, 1, fields[i].getXpos(), fields[i].getYpos() + fields[i].getHeight(), cb);
Its working fine. I guess sometimes if the cell's height is not large enough, we don't really see the effect. Try making the cell's height larger.
Raymond
From: kathy <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [iText-questions] vertical align in cell. Date: Mon, 15 Sep 2003 14:13:40 -0700
Hi all,
I encountered the problem of vertical alignment in PDFPCell. Whether the vertical align setting not working well in iText? If I had set the vertical align together with or without the setting of leading and padding within the cell, then the vertical align is will not working properly. Why such situation happen? Any solution to this problem? Thanks
Kathy.
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
_________________________________________________________________
Keep track of Singapore & Malaysia stock prices. http://www.msn.com.sg/money/
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
