Re: [xsl] evaluate rendered text lenght

Subject: Re: [xsl] evaluate rendered text lenght
From: Brandon Ibach <brandon.ibach@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 May 2011 11:59:03 -0400
My approach to cases where I seem to need the rendered dimension of
something has generally been to set up a two-pass system.  I generate
an XML area tree from the formatter (FOP or otherwise) on the first
pass, read the necessary information from that and incorporate it in a
second pass.  The second pass could either modify the area tree and
then format it directly or regenerate the FO from source,
incorporating the extra information in the process.

All that said, FO does have at least a few tricks up its sleeve that
may allow you to side-step the apparent need for the rendered length.
Can you tell us about the use case that's driving your requirement for
the rendered length?  Maybe we can suggest a way around it.

-Brandon :)


On Tue, May 24, 2011 at 6:05 AM, Giuseppe Briotti <g.briotti@xxxxxxxxx>
wrote:
> Hi all, I would like to evalutate the lenght of a string as it will be
> rendered in FOP. Of course, because of FOP formatting strategy, this
> info can be just an approximation, but for my purpouse can be enough.
>
> I've seen the Eliot Kimber extension (Function "renderedTextLength")
> but it is no longer available on Innodata Isogen web site. There are
> other alternatives?
>
> TIA
>
> Giuseppe Briotti

Current Thread