Hi All

briefly:

I am using ColumnText.showTextAligned() in the onEndPage() to display the
footer text but
it doesnt support multiline text. Is there an alternative component that I
can use to
display multiline text?


In Detail:

I basically want to implement a footer in the format below:

"
This is footer text and should continue onto the next
line when the max page width within the set margins
has been reached.
                      page <No>
"

In onEndPage()
My code looks like this:
//////////////////////////////////Footer//////////////////////////////////////////////////////////
ColumnText.showTextAligned(writer.getDirectContent(),
                  Element.ALIGN_CENTER, new Phrase("page "+
writer.getPageNumber() ),
                      (rect.left() + rect.right()) / 2, rect.bottom() + 0,
ELEMENT_ROTATION);

ColumnText.showTextAligned(writer.getDirectContent(),
                  Element.ALIGN_CENTER, new Phrase("This is footer text and
should continue onto the next"),
                      (rect.left() + rect.right()) / 2, rect.bottom() + 20,
ELEMENT_ROTATION);

ColumnText.showTextAligned(writer.getDirectContent(),
                      Element.ALIGN_CENTER, new Phrase(" line when the max
page width within the set margins "),
                          (rect.left() + rect.right()) / 2, rect.bottom() +
40, ELEMENT_ROTATION);

ColumnText.showTextAligned(writer.getDirectContent(),
                      Element.ALIGN_CENTER, new Phrase(" has been reached.
"),
                          (rect.left() + rect.right()) / 2, rect.bottom() +
60, ELEMENT_ROTATION);

//////////////////////////////////End of
Footer////////////////////////////////////////////////////



I've tried \n to start new lines but it didnt work.

ps: I have tried to search for an answer to my questions quite rigorously
but couldnt find it.Even if you tag the question newb please try to answer
it or give me some pointers to work on.

thanks a lot in advance :)

ali
------------------------------------------------------------------------------

_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to