I'm using iText to create a nicely formatted doc using mostly Paragraphs (some
just
containing newlines for spacing purposes) and PdfPTables (letting iText decide
where
this stuff lands on the page).

My doc happens to also have some text *manually* placed near the bottom of the
doc.
That text gets placed using something like:

PdfContentByte cb = writer.getDirectContent(); // Get the iText "top layer" of
our pdf doc.
BaseFont bf = BaseFont.createFont( BaseFont.HELVETICA, BaseFont.CP1252,
BaseFont.NOT_EMBEDDED ); // No idea what that CP1252 means.
cb.beginText();
cb.setFontAndSize(bf, 10);
cb.showTextAligned( PdfContentByte.ALIGN_LEFT, getMyString(), left_side,
uppermost, 0 );
cb.endText();

While I'm adding text to this page (to big PdfPCell in a PdfPTable in the
middle of the page),
what I need is a way to add a new page once the text I'm adding reaches a
certain point
down the page.

The only way I can figure to do that is to count newlines inside this big
PdfPCell, and then
when I hit some predefined max, finish up the cell/table and add a new page to
the doc
so I can resume my cell on the next page (not sure how I'd do that though, and
still get
the nice manually placed "footer").

How can I tell where I am in the page -- from inside my
Paragraph/PdfPCell/PdfPTable --
so I know when to end the page and start a new one?

Thanks a ton,
---John



                
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to