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 Michonska Sylvie <sm...@sopragroup.com> on 2009/02/09 17:41:09 UTC

Not want Space between inlines

Hello,

I use FOP to transform XML files to PDF files.

I use a style sheet to transform my XML to FO :
For an paragraph, i build a fo:block with some inlines, 
each inline contents differents attributs (different font, different color or/and ..)

With FOP 0.94, in my PDF, the inlines are separate by a space (between each inline).
I don't want this space. 
Before, with FOP 0.20.5, the same fo:block and some fo:inline don't product these spaces.

I think that i must use un attribut but i don't find it.

Thank you for your help.
Sylvie.




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Not want Space between inlines

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I'm not sure I'm hitting the right spot here, but you could try to use
linefeed-treatment="ignore" (default is "treat-as-space"). Your
stylesheet may be responsible for adding whitespace or more probably
line feeds which would explain the unwanted spaces. Without seeing your
FO file it's difficult to guess.

See also:
http://www.w3.org/TR/xsl11/#linefeed-treatment

On 09.02.2009 17:41:09 Michonska Sylvie wrote:
> Hello,
> 
> I use FOP to transform XML files to PDF files.
> 
> I use a style sheet to transform my XML to FO :
> For an paragraph, i build a fo:block with some inlines, 
> each inline contents differents attributs (different font, different color or/and ..)
> 
> With FOP 0.94, in my PDF, the inlines are separate by a space (between each inline).
> I don't want this space. 
> Before, with FOP 0.20.5, the same fo:block and some fo:inline don't product these spaces.
> 
> I think that i must use un attribut but i don't find it.
> 
> Thank you for your help.
> Sylvie.


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Not want Space between inlines

Posted by Michonska Sylvie <sm...@sopragroup.com>.
Hello,

This problem (space between inline) come  CRLF (linebreak) between the
inline tags in the file .fo
If i suppress the linebreak, i don't have the space between the text.

If i transform by fop (0.94) directly the xml file in pdf file,
i don't have this problem.
I have this problem only, during the debug test, if i transform the xml
file
in fo file, and then the fo file in pdf file.

Sorry for my first message, 
if i transform in FOP 0.20.5 the xml file in fo file, then, fo file in
pdf file,
i have  the same problem.

My main need is to transform a xml file to pdf file.
If the xml file don't content CRLF (linebreak) between tags,
the pdf file is good.

For the moment, it's OK.
Thank you.

Sylvie.



-----Message d'origine-----
De : Andreas Delmelle [mailto:andreas.delmelle@telenet.be]
Envoye : lundi 9 fevrier 2009 18:41
A : fop-users@xmlgraphics.apache.org
Objet : Re: Not want Space between inlines


On 09 Feb 2009, at 17:41, Michonska Sylvie wrote:

Hi

> I use a style sheet to transform my XML to FO :
> For an paragraph, i build a fo:block with some inlines,
> each inline contents differents attributs (different font, different  
> color or/and ..)

A small hint:
If you can, try to use fo:wrapper instead of fo:inline. That's much  
less of a drain on resources. This is only possible if you do NOT need  
non-inheritable properties (like border or padding, for example) or  
special alignment-adjust.
For inheritable properties like font-* and color, fo:wrappers work  
just as well, but they are much more light-weight than fo:inlines.

[Note to self: should REALLY add this remark to the performance hints  
on the site. Can have a significant impact in larger documents.]

> With FOP 0.94, in my PDF, the inlines are separate by a space  
> (between each inline).
> I don't want this space.
> Before, with FOP 0.20.5, the same fo:block and some fo:inline don't  
> product these spaces.

As Jeremias already noted: very difficult to judge without looking at  
the FO file, but it is very likely that the undesirable white-space is  
actually a result of the built-in template rule for text() being  
triggered somewhere (so actually comes from the source XML).

Overriding that built-in template rule in your stylesheet, like so:

<xsl:template match="text()">
   <xsl:value-of select="normalize-space(.)" />
</xsl:template>

Could mean that you don't even need special FO attributes, as it will  
already filter out this unwanted white-space at the XSLT stage, so FOP  
doesn't even see it.


HTH!

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Not want Space between inlines

Posted by Andreas Delmelle <an...@telenet.be>.
On 09 Feb 2009, at 17:41, Michonska Sylvie wrote:

Hi

> I use a style sheet to transform my XML to FO :
> For an paragraph, i build a fo:block with some inlines,
> each inline contents differents attributs (different font, different  
> color or/and ..)

A small hint:
If you can, try to use fo:wrapper instead of fo:inline. That's much  
less of a drain on resources. This is only possible if you do NOT need  
non-inheritable properties (like border or padding, for example) or  
special alignment-adjust.
For inheritable properties like font-* and color, fo:wrappers work  
just as well, but they are much more light-weight than fo:inlines.

[Note to self: should REALLY add this remark to the performance hints  
on the site. Can have a significant impact in larger documents.]

> With FOP 0.94, in my PDF, the inlines are separate by a space  
> (between each inline).
> I don't want this space.
> Before, with FOP 0.20.5, the same fo:block and some fo:inline don't  
> product these spaces.

As Jeremias already noted: very difficult to judge without looking at  
the FO file, but it is very likely that the undesirable white-space is  
actually a result of the built-in template rule for text() being  
triggered somewhere (so actually comes from the source XML).

Overriding that built-in template rule in your stylesheet, like so:

<xsl:template match="text()">
   <xsl:value-of select="normalize-space(.)" />
</xsl:template>

Could mean that you don't even need special FO attributes, as it will  
already filter out this unwanted white-space at the XSLT stage, so FOP  
doesn't even see it.


HTH!

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org