You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by shuva sinha <xs...@yahoo.co.in> on 2003/11/20 11:31:17 UTC
XSL-FO Problem (Line not coming as proper location)
Hi,
I am facing some problems at the time of writing xsl-fo. In pdf output below date (which is given below in xml document) line will come. I have given fo:leader in xsl-fo for the line. But both the date & line are not coming what is supposed to be as per xml document.
Any suggestion or help will be apprciated.
Thanks & Regards,
Saurabh
Here the text.xml file
--------------------------------
<pdf-doc>
<para>This is normal text within paragraph. This is normal text within paragraph. <date>12.11.03</date>This is normal text within paragraph. This is normal text within paragraph. </para>
</pdf-doc>
Here the text.xsl file
-----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="main" margin-top="25pt" margin-bottom="25pt" margin-left="75pt" margin-right="85pt">
<fo:region-body margin-bottom="75pt"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="main">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="para">
<fo:block font-family="sans-serif" font-size="7pt" line-height="8pt" space-before.optimum="8pt" space-after.optimum="8pt" start-indent="-15pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="date">
<fo:table>
<fo:table-column column-width="30pt"/>
<fo:table-body>
<!-- 1st row -->
<fo:table-row>s
<fo:table-cell>
<fo:block font-size="7pt" font-family="Helvetica, Arial, sans" space-before.optimum="-2pt" font-weight="bold">
<xsl:value-of select="."/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<!-- 2nd row -->
<fo:table-row>
<fo:table-cell>
<fo:block space-before.optimum="-8pt">
<fo:leader leader-length="100%" leader-pattern="rule" rule-thickness="0.5px"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet>
current text.pdf is attached for your reference.
Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now.
Re[2]: XSL-FO Problem (Line not coming as proper location)
Posted by Torsten <To...@net-linx.de>.
Hello shuva,
Friday, November 21, 2003, 4:58:52 AM, you wrote:
ss> Hi Pietschmann,
ss>
ss> Thanks for your help. But what I want exactly it is not
ss> coming. If I use underline then the output will be
ss>
ss> 12.11.03
ss> ------------
ss>
ss> So the length of the line depends on text, if the text is too
ss> long then line will be long text is small then line will be
ss> short.
ss>
ss> In my case pdf output will be like this
ss>
ss> 12.11.03
ss> ----------------------------------
X--snip
I'm not really sure, how FOP's graphics implementation works, but it seems to be <fo:block
space-before.optimum="-8pt"> is outside the clipping Area so it
wouldn't be drawn anytime.
What about using -- border-bottom="solid" -- in your Date Table Cell
--
Best regards,
Torsten mailto:Torsten.Erler@net-linx.de
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: XSL-FO Problem (Line not coming as proper location)
Posted by "J.Pietschmann" <j3...@yahoo.de>.
shuva sinha wrote:
> I am using <fo:leader> in xsl. But it is not coming.
Another attempt at guessing what your problem might be:
use text-align-last="justify", see also:
http://xml.apache.org/fop/faq.html#leader-expansion
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: XSL-FO Problem (Line not coming as proper location)
Posted by shuva sinha <xs...@yahoo.co.in>.
Hi Pietschmann,
Thanks for your help. But what I want exactly it is not coming. If I use underline then the output will be
12.11.03
------------
So the length of the line depends on text, if the text is too long then line will be long & text is small then line will be short.
In my case pdf output will be like this
12.11.03
----------------------------------
I am using <fo:leader> in xsl. But it is not coming.
Any suggestion will be appreciated.
Regards,
Saurabh
Here the text.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<pdf-doc>
<para>This is normal text within paragraph. This is normal text within paragraph. <date>12.11.03</date>This is normal text within paragraph. This is normal text within paragraph. </para>
</pdf-doc>
Here the text.xsl is
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="main" margin-top="25pt" margin-bottom="25pt" margin-left="75pt" margin-right="85pt">
<fo:region-body margin-bottom="75pt"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="main">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="para">
<fo:block font-family="sans-serif" font-size="7pt" line-height="8pt" space-before.optimum="8pt" space-after.optimum="8pt" start-indent="-15pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="date">
<fo:table>
<fo:table-column column-width="30pt"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block font-size="7pt" font-family="Helvetica, Arial, sans" space-before.optimum="-2pt" font-weight="bold">
<xsl:value-of select="."/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block space-before.optimum="-8pt">
<fo:leader leader-length="30%" leader-pattern="rule" rule-thickness="0.5px"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet>
"J.Pietschmann" <j3...@yahoo.de> wrote:shuva sinha wrote:
> In pdf output below date (which is given below in xml document) line will
> come. I have given fo:leader in xsl-fo for the line. But both the date & line
> are not coming what is supposed to be as per xml document.
A table is a block level element. You can't use it inline without
the help of an inline container, a fearture which isn't implemented
yet.
It seems you could use underlining:
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now.
Re: XSL-FO Problem (Line not coming as proper location)
Posted by "J.Pietschmann" <j3...@yahoo.de>.
shuva sinha wrote:
> In pdf output below date (which is given below in xml document) line will
> come. I have given fo:leader in xsl-fo for the line. But both the date & line
> are not coming what is supposed to be as per xml document.
A table is a block level element. You can't use it inline without
the help of an inline container, a fearture which isn't implemented
yet.
It seems you could use underlining:
<xsl:template match="date">
<fo:wrapper text-decoration="underline">
<xsl:apply-templates/>
</fo:wrapper>
</xsl:template>
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org