You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ecs-user@jakarta.apache.org by ni...@na.biomerieux.com on 2002/05/30 16:31:14 UTC

Walking over the contents of a Table object

Hello all,

I am interested in extending the capabilities of the Body class so that it
can keep track of how "print space" is needed to print the current Body.  I
am only going to be adding Table objects to the Body.

Question 1) Is is possible to "iterate" over the elements added to an
element (e.g. the elements added to the body).
Question 2) Can you provide an brief example

After verifing that that only Table objects have been added to the Body.
For each Table, I wanted to count the number of rows (TD objects) that have
been added.  For each row, I wanted to compute the height of the row (is
done by finding the maximum font size used in any of the TD elements).  By
adding up all the "print space" needed for each of the rows, I can compute
the "print space" for the table.  Do the above for each Table in the Body,
I can then compute the "print space" for the body?

Question 3) Does that above seem like a logical approach?  Again remember,
that context that I am using this is that all my printing is done within
Table objects that are added to the document (no free standing BR or HR's,
though the above solution could be extended).

The goal of the scheme is to allow the developer knowlege of the "print
space" currently in use.  Because, armed with that info, along with some
printer attributes (page size, orientation, etc...) the developer will be
able to determine the how far on a printed page they are so that will know
if a given Table object will be "page-split" if they added it to the
document and then they can opt to insert a "page-break" and/or a footer and
then add the Table, knowing that it will print on the next page.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>