>If your ColumnText object says there's still more text,
>then that's what you should do.

Thanks Bruno,
I got it to work. The problem was - I was creating a new ColumnText object
for each new page inserted using PdfStamper. However, I changed it to
continue using the old ColumnText Object but set the canvas to the new
PdfContentByte for the newly inserted page and then call go() again, like:

//Add lots of text
columnText.addText(new Phrase("Large amount of text",font);
...
...
// Loop thru and render text possibly moving to a new page if required
while ((status & ColumnText.NO_MORE_TEXT) == 0) {
      status = columnText.go(); 
      if ((status & ColumnText.NO_MORE_COLUMN) != 0) {                          
   
        stamper.insertPage(pageNumber, pageSize);
        contentByte = stamper.getOverContent(pageNumber);
        columnText.setCanvas(contentByte );
     }
}



-- 
View this message in context: 
http://www.nabble.com/Problems-Using-ColumnText-with-PdfStamper-tf4426102.html#a12631924
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to