Bruno Lowagie (iText) wrote: > > The first thing you need to know that a PdfPCell is treated as a > ColumnText object. > There are two ways to add content to a ColumnText object: > - in text mode > - in composite mode > When you add objects in text mode, the alignment of the object is ignored. > You have to set the alignment at the ColumnText/PdfPCell level. > When you add objects in composite mode, the alignment of the objects is > preserved, but you may loose ColumnText/PdfPCell properties. > > To solve your problem, use: > PdfPTable table = new PdfPTable(1); > table.setWidthPercentage(100f); > Phrase phrase = new Phrase(new Chunk("Hello",font)); > PdfPCell cell = new PdfPCell(phrase); > cell.setHorizontalAlignment(Element.ALIGN_RIGHT); > cell.setPadding(padding); > table.addCell(cell); > > HTH, > Bruno > >
I dont fully understant the diffarece between 'text mode' and 'composite mode' (witch might bee my problem). I need to set RUN_DIRECTION = RTL and ALINGMENT = RIGHT. I did so in the attaced Peace example from chapter 6 but with no sucsess. what am I missing? Tank's Eli http://www.nabble.com/file/p20643708/Peace%2B.java Peace+.java http://www.nabble.com/file/p20643708/peace.xml peace.xml -- View this message in context: http://www.nabble.com/alignment-problem-with-PdfPCell---Paragraph-tp4139265p20643708.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php