Re: [xsl] Header Text Overflows Body Section Title

Subject: Re: [xsl] Header Text Overflows Body Section Title
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Nov 2007 12:41:42 -0500
At 2007-11-19 09:25 -0800, Horace Burke wrote:
I am having some issues with text overflowing from a page header into a
section titles. This is in PDF output generated from an XSL-FO stylesheet.
I have included snippets from the XML and stylesheet. The XML snippets
show three possible variations of data in a <para> element that will
display in the document header. I want to know if there is anyway for me
to have the "margin-top" in <fo:region-body...> formatting object to
extend/increase depending on the amount of data in the product name
paragraph ("<ProdName><para>") element.

No ... this is not an elastic construct.

I came across this in a project where security classifications were displayed in headers and footers. For any given document, however, the length of the classifications wrapped to an arbitrary number of lines (one valid example we had extended to six lines).

The extents of perimeter regions and the margins of the body region cannot change to reflect the amount of filled content. Thus, we actually counted the characters and estimated the number of lines and then declared the extents and margins based on the line count. We did not do this so accurately as to utilize the font metrics to guarantee the line count was precise ... everything was capital letters so we just did a character count.

The complexity of your line counting algorithm is related to how important it is to accurately reflect line breaks. There are no guidelines.

We erred on the excess so that there were a few documents where the header was accidentally one line longer than it needed to be ... but the document readers couldn't really tell that the excess gap of one line was too much. When the gap was three lines, they could tell and they would complain, which is why we started counting characters. One line too much and they didn't say a word.

With that evidence, our simple character counting was sufficient and we didn't need to incorporate font metrics into the calculation.

I hope this helps.

. . . . . . . . . . . . . Ken

-- Comprehensive in-depth XSLT2/XSL-FO1.1 classes: Austin TX,Jan-2008 World-wide corporate, govt. & user group XML, XSL and UBL training RSS feeds: publicly-available developer resources and training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Nov'07 Legal business disclaimers:

Current Thread