Vertical alignment in table cells was broken in version 1.02b and previous. It should be working in all subsequent versions (including current). If you are having problems with the current version, please post a simple example in Java.

----- Original Message ----- From: "Bhasker Konakanchi" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, January 27, 2005 12:57 PM
Subject: [iText-questions] Vertical alignment in a table cell



Hi,

I am using iText with CFMX. For this I have wrapped some of the frequently
used iText API inside cfc.



I am trying to add a simple text element to a cell and set the vertical
alignment of the cell to the middle. It does not look like it is working for
me. The text sticks to the bottom of the cell. When I tried to set the
leading of the text element to 0 (not shown in the sample code) the text
element aligned it self to the the top of the cell.  Am I missing some thing
here?



My code looks like this:





table = createObject("component", "PDF.table");

table.init(columns=4);

table.setWidth(width=100);



temp2 = arrayNew(1);

temp2[1] = 10; temp2[2] = 25;

temp2[3] = 25; temp2[4] = 40;

table.setWidths(iWidths=temp2); // passing an integer array



// setting up cell, paragraph  and font object instances

cell = createObject("component", "PDF.cell");

fontFactory = createObject("component", "PDF.fontFactory");

font = createObject("component", "PDF.font");

normalFont = fontFactory.getFont(fontName=font.TIMES_ROMAN, size=12);

para = createObject("component", "PDF.paragraph");



para.init(stringTxt="test", font=normalFont); // constructing a paragraph

cell.init(element=para); // constructing a cell

cell.setVerticalAlignment(value=cell.align_middle);  // setting the vertical
alignment - BUT DOES NOT WORK

table.addCell(aCell=cell);





Thanks in advance,

Bhasker






------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to