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).

The code you've posted does not take into account document.newPage() - in my case the problem only happens after a new page is opened.


I have experimented with changing the page size both before and after the document.newPage() call, and it makes no difference.

It seems that it is possible to change from portrait to lanscape in the middle of a document, but changing from landscape back to portrait again is impossible.

Can anyone see where the problem might lie?

        /* set up the document */
        document.setPageSize(PageSize.A4);

        /* create a footer for this document */
        document.setFooter("footer string");

        /* open the document */
        if (document.isOpen()) {
                document.newPage();
        } else {
                document.open();
        }

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