It's setTotalWidth(). If you don't set the table width there's no way
for the table to calculate the height.
> -----Original Message-----
> From: itext-questions-admin@(protected)
> [mailto:itext-questions-admin@(protected)
> Behalf Of Trey Ethridge
> Sent: Thursday, June 16, 2005 4:05 PM
> To: itext-questions@(protected)
> Cc: tale@(protected)
> Subject: RE: [iText-questions] Ensure margin is large enough?
>
>
> I'm confused by your reply. 2 questions.
>
> 1. I'm using the code from the documentation to add header
> and footers, but it doesn't take into account the height of
> the table (from what I can tell). How can I change this
> example to ensure that the margin is big enough to contain
> the contents of the table?
>
> Here is a link to the example I'm using.
> http://itextdocs.lowagie.com/examples/com/lowagie/examples/dir
> ectcontent/pageevents/EndPage.java
>
>
> 2. Did you mean setTotalHeight?
>
>
> -- Trey
>
> -- "Paulo Soares" <psoares@(protected):
> Call setTotalWidth(), the table can't guess what is the page
> width minus
> the margins.
>
> > -----Original Message-----
> > From: itext-questions-admin@(protected)
> > [mailto:itext-questions-admin@(protected)
> > Behalf Of Trey Ethridge
> > Sent: Thursday, June 16, 2005 3:32 PM
> > To: itext-questions@(protected)
> > Subject: [iText-questions] Ensure margin is large enough?
> >
> >
> > Hello all,
> >
> > I'm writing a report using itext. The report is generic and
> > can be configured by the user. The user can specify what
> > they want in the header and footer, along with the size and
> > color of the font. Since the font size can change, I'm
> > trying to get the margin to be dynamic so that the font won't
> > be cut off if the user makes the font bigger.
> >
> > So what I'm doing is creating the content of the header and
> > footer in 2 PdfPTables. Then I check the height of the
> > header table. If it is larger than my default marginTop,
> > then I increase marginTop to the size of the table plus a
> > little buffer. Then I create the document with the adjusted
> > margins. The problem is that the table always returns zero.
> > Why? How should I do this? Here is an example of what I'm doing.
> >
> > // Make sure we have enough room for the header.
> > if (header.getTotalHeight() > marginTop)
> > {
> > marginTop = header.getTotalHeight() + marginBuffer;
> > }
> >
> > Thanks in advance,
> > -- Trey
> >
> > ___________________________________________________________________
> > Get Juno Platinum for as low as $6.95/month!
> > Unlimited Internet Access with 250MB of Email Storage.
> > Visit http://www.juno.com/bestoffer to sign up today!
> >
> >
> >
> > -------------------------------------------------------
> > 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_id=7477&alloc_id=16492&op=click
> > _______________________________________________
> > iText-questions mailing list
> > iText-questions@(protected)
> > 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@(protected)
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> ___________________________________________________________________
> Get Juno Platinum for as low as $6.95/month!
> Unlimited Internet Access with 250MB of Email Storage.
> Visit http://www.juno.com/bestoffer to sign up today!
>
>
>
> -------------------------------------------------------
> 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_id=7477&alloc_id=16492&op=click
> _______________________________________________
> iText-questions mailing list
> iText-questions@(protected)
> 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@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions