I found the source of this behavior, in the source code for MultiColumnText in the write() method. The method currently uses the documentY position passed to it as the top of the columns on all pages.
The modification I made below makes the top of the columns start wherever the current document writing position is when it gets around to writing the columns for the page. Current Library Behavior: ---------------------------------------------------------- ( Y = 800 ) | Banner graphic | ---------------------------------------------------------- [ Introductory text paragraph, of variable length when ( Y = 700 ) building the document ] [ multi-column listing ] [ ] ( Y = 600 ) [ ] [ ] [ ] [ ] ... Page 2 just continues the listing: [ Blank space ] ( Y = 800 to 600 ) [ multi-column listing ] [ ] ( Y = 600 ) [ ] [ ] [ ] [ ] ... Modified Library Behavior: ---------------------------------------------------------- ( Y = 800 ) | Banner graphic | ---------------------------------------------------------- [ Introductory text paragraph, of variable length when ( Y = 700 ) building the document ] [ multi-column listing ] [ ] ( Y = 600 ) [ ] [ ] [ ] [ ] ... Page 2 just continues the listing: [ multi-column listing ] [ ] ( Y = 800 ) [ ] [ ] [ ] [ ] ... The modified behavior seems to be more along the lines of what you would expect to happen. Ron /** * Write out the columns. After writing, use * [EMAIL PROTECTED] #isOverflow()} to see if all text was written. * @param canvas PdfContentByte to write with * @param document document to write to (only used to get page limit info) * @param documentY starting y position to begin writing at * @return the current height (y position) after writing the columns * @throws DocumentException on error */ public float write(PdfContentByte canvas, PdfDocument document, float documentY) throws DocumentException { this.document = document; columnText.setCanvas(canvas); if (columnDefs.size() == 0) { throw new DocumentException("MultiColumnText has no columns"); } overflow = false; pageBottom = document.bottom(); float currentHeight = 0; boolean done = false; try { while (!done) { if (nextY == AUTOMATIC) { //nextY = documentY; <-- Original method, top of columns start at same point on every page. nextY = document.getVerticalPosition(true); // RS - 07/07/2005 - - Get current doc writing position for top of columns on new page. } if (top == AUTOMATIC) { //top = documentY; // shouldn't I be able to get this from the document? top = document.getVerticalPosition(true); // RS - 07/07/2005 - Get current doc writing position for top of columns on new page. } ... ----- Original Message ----- From: "Ron Savage (CE CEN)" <[EMAIL PROTECTED]> Date: Monday, July 4, 2005 11:26 am Subject: [iText-questions] Tips for Multi-column, multi-page document with graphic and intro on page 1 only > The document I'm trying to create looks basically like this: > > Page 1: > > ---------------------------------------------------------- > | Banner graphic | > ---------------------------------------------------------- > > [ Introductory text paragraph, of variable length when > building the document ] > > [ multi-column listing ] [ ] > [ ] [ ] > [ ] [ ] > ... > > Page 2 just continues the listing: > > [ multi-column listing ] [ ] > [ ] [ ] > [ ] [ ] > ... > > > This works fine so far by just adding the image, then a > paragraph, then the MulticolumnText objects to the document. > > My problem is that on Page 2 and all subsequent pages, the > MulticolumnText section starts at the same location that it > did on page 1, leaving a gap on the page where the graphic > and intro paragraph existed on page 1. > > Can anyone point me to an example or give brief explanation > of how to accomplish this with a minimum of coding? > > Thanks in Advance, > > Ron > > > ------------------------------------------------------- > 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_idt77&alloc_id492&opÕick > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > ------------------------------------------------------- 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_idt77&alloc_id492&op=click _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions