Tobias, We have a similar need for auto table sizing, but we also have an additional need for "table wrapping", so we simply had to come up with an alternative solution. Since the FO is generated from XSLT, we can pass the page width and margin values as parameters to the XSLT stylesheets that can be used to get the "body width" of the table. Then, we have a complicated algorithm that analyzes the text that will go into each cell and calculates its approximate width based on the number of chars in the largest string in that column. We use that value in combo with the body width to know how many columns will fit on the page and how wide each column needs to be.
At this point in time the character metrics are stored in a lookup table for a controlled set of fonts and font sizes. Certain combinations of characters cause the metric approximation to get all haywire, though, so we're beginning to look at a way we can possibly use XSLT extension functions to have Java and its FontMetrics class better approximate the width and height of the strings. Overall, however, the algorithm doesn't change. >From what I've read on the mailing lists before, yes, there is a patch >somewhere in the Bugzilla queue that attempts to offer some auto table sizing >algorithm but that it doesn't yet work for all cases and is an *extremely >complicated* algorithm to complete. Sean -----Original Message----- From: Tobias Anstett [k15t.com] [mailto:tob...@k15t.com] Sent: Wednesday, May 27, 2009 12:40 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Auto Table Column Width Hi, please see my original question below. Furthermore I'd like to know if there are already approaches or ongoing development on this issue. Do you know how other FO processors capable of this feature have solved the problem. Would be nice if you can provide me additional information what happend so far or not - so maybe we can help and work on/contribute a solution in one of the next releases. Cheers, Tobias On Wed, May 20, 2009 at 9:18 PM, Tobias Anstett [k15t.com] <tob...@k15t.com> wrote: > Hi, > > I know that auto table column width is currently not supported by FOP > 0.9.5. But is there a way to get the actual width of a table in the > document (page - some indents) and calculate the column width like the > CSS2 algorithm does? > > Or has anybody tried to render tables with iText and replace them > automatically in the generated FOP->PDF ? > > -- > Cheers, > Tobias > > > ________ > K15t Software UG (haftungsbeschränkt), http://www.k15t.com > Rosenbergstr. 58, 70176 Stuttgart, GERMANY > Registration: Stuttgart HRB 729752, VAT ID: t.b.a. > Geschäftsführer (CEO): Klaus-Dieter Krüger > ---------------------------------------------------------------------- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org