You must change the page size before newPage(). There's always a degree of uncertainty about when a paragraph goes to the next page and that can cause problems even in well written programs. Layout rules are a complex subject and even TEX gets it wrong sometimes.
All the apps I have in production use PdfPTable and ColumnText placed at absolute positions using my (simple) layout rules. The extra effort is not that much and the results are always as expected. Best Regards, Paulo Soares > -----Original Message----- > From: Graham Leggett [mailto:[EMAIL PROTECTED] > Sent: Friday, March 26, 2004 12:05 PM > To: Paulo Soares > Cc: [EMAIL PROTECTED] > Subject: Re: [iText-questions] Switching from landscape to > portrait to landscape again - broken > > Paulo Soares wrote: > > > I can reproduce the problem with the following program: > > > > document.setPageSize(PageSize.A4.rotate()); > > document.open(); > > Table t = new Table(5); > > t.setWidth(100); > > for (int k = 0; k < 500; ++k) > > t.addCell("" + k); > > document.setPageSize(PageSize.A4); > > document.add(t); > > document.close(); > > > > What happens is that the table width is set in page 1 > (landscape) and > > extends to the other pages (portrait) keeping the dimensions of the > > first page. I don't know if I should consider it a bug, a > table changing > > width between pages is probably not what you want either. > > The solution is to only do any page size changes after > > document.add(table). > > In my case I am only doing page sizes just before a new page > is opened. > I have done a search in the code, and there are no stray page sizes > being set. > > When is the correct time to change a page size? Before or after a > document.newPage()? > > Regards, > Graham > -- > > > ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
