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_id=1470&alloc_id=3638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to