The vertical alignment of the text shall be middle to the image (which shall be placed on the left). Between the image and the following text there shall be some space.
Using this code, the text after the image is placed on the baseline:
PdfPCell cell = null;
Chunk ch = new Chunk(image, 0, 0);
Paragraph p = new Paragraph(15, ch);
p.setIndentationLeft(15);
p.setFirstLineIndent(0);
Chunk msNamePhrase = new Chunk("Milestone " + milestoneNameX + " " + milestoneAddition, headerFont);
//msNamePh rase.setTextRise(image.plainHeight() / 2);
p.add(msNamePhrase);
p.setAlignment(Paragraph.ALIGN_MIDDLE | Paragraph.ALIGN_CENTER); // no effect
cell = new PdfPCell(p);
cell.setBorderWidth(1);
cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
headTable.addCell(cell);
...
How can I achieve this?
I have also tryed to put image and text in a separate cell of a table of four cells and to set the rightBorderWidth of the first and the leftBorderWidth of the second cell to 0. This ends up in a ta ble with a thinner outer border for the first both cells. ???
BTW: If I add a value to a PdfPCell and then try to ADD a further value with PdfPCell.add(...) the first value will be replaced instead of being added as expected. This method should be named setValue or put or so, shouldn't it? The add method should really add something to the already existing value of this cell. What do you think about this?
Regards
Dirk
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions