-none- 2007-10-01 - By Bruno Lowagie (iText)
Back Marty Katz wrote: > Not sure how to describe it clearly but I'll try > again. > > Basically, the first page of the doc needs to contain > 4 items in this order: > > A) header > B) list of accounts > C) disclaimer > D) footer > > All subsequent pages contain only A, B, and D. > > I print the header and footer using subclass of > PdfPageEventHandler and I do this outside the margins.
So the problem is reduced to B and C.
> The length of the list of accounts (B) is variable > (may be one account, may be hundreds). The size of > the other elements is fixed. > > If there is only one account, lets say, I want to > print that one and then add the disclaimer right after > it on on the first page. > > But if there are many accounts, I want to start > printing the list on the first page, then add the > disclaimer to the first page when the space remaining > in the margins on the first page is just big enough > for the disclaimer. Then I want to continue printing > the list of accounts on page 2 and continue for > however many pages it takes to fit the remainder of > the list.
Work with ColumnText. Let's say, you have a bottom margin BOTTOM, and a top margin TOP.
First add the disclaimer (C) to a ColumnText and add the column to the document in simulation mode (anywhere on the page, just make sure you define the width of the column correctly).
Ask the column how much space it takes vertically, for instance H. Now add the disclaimer for real, also with ColumnText, and make sure the Y-coordinates are something like this: top = BOTTOM + H, bottom = BOTTOM.
Now create a column for the content (D), but make sure you define the first rectangle doesn't go beyond BOTTOM + H. On the subsequent pages define the column so that it fits between the top en bottom margins.
I still don't understand why you are asking this question. I don't see the problem. br, Bruno
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- 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 iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|