W3C home > Mailing lists > Public > www-xsl-fo@w3.org > June 2003

Line break Issue.

From: Jignesh Shah <jshah@mdnotes.com>
Date: Thu, 5 Jun 2003 17:46:15 -0400
Message-ID: <6ED02078F47515408A210DC2124C84D701C13E@MDN-MAIN.mdnotes.com>
To: <XSL-FO@egroups.com>, <pittjug@yahoogroups.com>, <www-xsl-fo@w3.org>, <fop-user-help@xml.apache.org>
I am finally at the end of finishing my first xsl-fo generated pdf
report using fop-0.20.4. The xml I generate has tags which are populated
by text from html <textarea> tags. These textarea texts preserve all the
spaces and the newline charcters.
I now want to display this information in pdf as:
Item description: 
1. This is a new item. 
2. It is on sale now
3. This item can be used for multipurpose jobs such as gardening, lawn
mowing, tree cutting, tree decorating and other purposes
4. It has a 30 day warranty
Item description: 
This is a new item. It is on sale now. This item can be used for
multipurpose jobs such as gardening, lawn mowing .......
Depending on how the user has entered it into the HTML form.
I have used <fo:block> and <fo:inline>. I cannot use the
linefeed-treatment and the white-space-treatment as they are not yet
implemented. <When I use the white-space-collapse="false"> I get the
data as I need but the whole <fo:block> is marginally shifted right from
the data in region-before content. Also wrap around text such as in
description #3 do not appear correctly. The second line starts
marginally on the left side (is actually aligned with the region-before)
text. I want every line on the pdf to be left aligned.
Here is the xsl:
<fo:page-sequence master-reference="firstAndRest">
    <fo:static-content flow-name="header-first">
        <xsl:call-template name="ProgessNoteHeaderFirst"/>
  <fo:static-content flow-name="header-rest">
      <xsl:call-template name="ProgessNoteHeaderRest"/>
    <fo:static-content flow-name="xsl-region-after">
      <fo:block text-align="center">
    <fo:flow flow-name="xsl-region-body">
        <xsl:call-template name="ProgressNoteBody"/>
<xsl:template name="ProgressNoteBody">
<xsl:variable name="a" select="Note_12"/>  <!-to display if only the xml
tag has some data -->
<xsl:if test="string-length($a) != 0 ">
<fo:block font-family="Times" font-size="11pt"> <!-to adda blank line
  <fo:inline &#160;</fo:inline>
<fo:block text-align="start" font-family="Times" font-size="11pt"
  <fo:inline font-weight="bold">
  <fo:inline text-align="start">
    <xsl:apply-templates select="Note_12"/>
Can anybody please help me out with this formatting structure.
Received on Thursday, 5 June 2003 17:50:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:09:58 UTC