I have a Paragraph that needs to be Left Aligned and vertically Middle
Aligned in a ColumnText. No matter how I set the alignment, the paragraph is
aligned at the top of the ColumnText.

 

I have tried setting the ColumnText alignment to ElementConst.ALIGN_MIDDLE
and the Paragraph alignment to ElementConst.ALIGN_LEFT

I have tried setting the Paragraph alignment to ElementConst.ALIGN_MIDDLE 

 

Here is some example code:

 

ContentByte cb;

ColumnText column;

Paragraph myParagraph;

Chunk ck;

 

// Writer is defined in code above this segment

cb = Writer.getDirectContent();

 

column = new ColumnText(cb);

column.setSimpleColumn(0.0, 0.0, 100.0, 500.0);

column.setAlignment(Element.ALIGN_MIDDLE);

 

myParagraph = new Paragraph(19.0);

myParagraph.setAlignment(Element.ALIGN_LEFT);

 

ck = new Chunk("This is some text.");

myParagraph.add(ck);

myParagraph.add(Chunk.NEWLINE);

 

myParagraph.add(new Chunk("This is an extra line."));

myParagraph.add(Chunk.NEWLINE);

 

ck = new Chunk("This is some more text ");

myParagraph.add(ck);

ck = new Chunk("blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah ");

myParagraph.add(ck);

ck = new Chunk("blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah.");

myParagraph.add(ck);

 

column.addText(myParagraph);

column.go();

 

 

I want it to look similar to this:

 

*********************************************************************

*                                                             

*                                                             

*                                                             

*                                                             

*                                                             

*This is some text.                                           

*This is an extra line.                                       

*This is some more text blah blah blah blah blah blah blah    

*blah blah blah blah blah blah blah blah blah blah blah blah  

*blah blah blah blah blah blah blah blah blah blah blah.      

*                                                             

*                                                             

*

*

*

********************************************************************

 

 

Jeff Brint

A. J. Bart, Inc - Lithographers

HYPERLINK "mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]

 

4130 Lindbergh Drive

Addison, TX 75001

Ph: (972) 960-8300

Cell (972) 571-6583

 


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.7.1/807 - Release Date: 5/16/2007
6:05 PM
 
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to