Hi all.

Is there any way to force FOP to underline a string, even if it is composed
entirely of blank characters? I'm using fop-0.20.3, if that matters.

I have a template which produces an underlined, fixed-length string in my
pdf doc. It pads the string with spaces if necessary to make it the desired
length. It works great, and a I get a padded string in the pdf document with
the required length and everything is underlined. Great :-)

The problem is when the string is composed entirely of blank spaces ... The
string has the correct number of blank characters
(white-space-collapse=false), but the string is not underlined.

Is there a way to force FOP to underline a string, even if it is composed
entirely of blank characters? 

Thanks for any help.

Here is the template:

  <!-- *** this is the format I want to use to display the string -->
  <xsl:attribute-set name="dataText">
    <xsl:attribute name="font-family">Courier</xsl:attribute>
    <xsl:attribute name="font-size">9pt</xsl:attribute>
    <xsl:attribute name="font-style">normal</xsl:attribute>
    <xsl:attribute name="font-weight">normal</xsl:attribute>
    <xsl:attribute name="language">en-US</xsl:attribute>
    <xsl:attribute name="text-decoration">underline</xsl:attribute>
    <xsl:attribute name="white-space-collapse">false</xsl:attribute>

  <!-- recursive template to pad a string with blanks -->
  <xsl:template name="append-pad">
    <!-- the value with whatever padChar is passed in   -->
    <xsl:param name="padChar"><xsl:value-of select="' '"/></xsl:param>
    <xsl:param name="padVar"/>
    <xsl:param name="length"/>

      <!-- **** check here to see if the padVar is nil -->

      <xsl:when test="boolean($padVar)">
          <xsl:when test="string-length($padVar) &lt; $length">
            <xsl:call-template name="append-pad">
              <xsl:with-param name="padChar" select="$padChar"/>
              <xsl:with-param name="padVar"
              <xsl:with-param name="length" select="$length"/>

      <!-- *** if the padVar is nil, make a string of entirely blank space
*** -->

        <xsl:call-template name="append-pad">
          <xsl:with-param name="padChar" select="$padChar"/>
          <xsl:with-param name="padVar" select="'&#160;'"/>
          <xsl:with-param name="length" select="$length"/>

Jack Donohue, Developer
Synovation Incorporated.
Providing integrated solutions for criminal justice.
Tel 209.491.0978 x 409
Fax 209.571.8853
Support 209.491.3600
Toll Free 800.774.8430

Reply via email to