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 Ernst Abbe <ha...@yahoo.de> on 2016/07/06 10:08:06 UTC

Float in combination with linefeed-treatment doubles a part of the text

I am using Apache FOP 2.1 with Java 1.8.0_40-b25 on CentOS 7.2.1511.

I am trying to let the text float around an image in the right upper
corner. When using linefeed-treatment=preserve, the text before the first
linefeed is shown again under the image.
Any help will be appreciated


<?xml version="1.0" encoding="UTF-8"?>
<xs:stylesheet version="1.0"
               xmlns:xs="http://www.w3.org/1999/XSL/Transform"
               xmlns:fo="http://www.w3.org/1999/XSL/Format">

    <xs:attribute-set name="body-style">
        <xs:attribute name="text-align">justify</xs:attribute>
        <xs:attribute name="font-size">7.4pt</xs:attribute>
        <xs:attribute name="linefeed-treatment">preserve</xs:attribute>
    </xs:attribute-set>

    <xs:template match="advert">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
            <fo:layout-master-set>
                <fo:simple-page-master master-name="ADVERT-TOP"
page-width="45mm" page-height="90.0mm">
                    <fo:region-body region-name="PageTop" column-count="1"
margin="0"/>
                </fo:simple-page-master>
            </fo:layout-master-set>
            <fo:page-sequence master-reference="ADVERT-TOP">
                <fo:flow flow-name="PageTop">

                    <fo:block-container>
                        <fo:block border="0.1pt solid green">

                            <fo:float float="right">
                                <fo:block border="0.1pt solid red">
                                    <fo:external-graphic height="10mm"
width="10mm" src="x"/>
                                </fo:block>
                            </fo:float>

                            <fo:block xs:use-attribute-sets="body-style"
border="0.1pt solid blue"
>xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx yy
oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow
oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo
oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo
oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo
                            </fo:block>

                        </fo:block>
                    </fo:block-container>

                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xs:template>
</xs:stylesheet>

Result:
xx xx xx xx xx xx xx xx xx xx xx 
xx xx xx xx xx xx xx xx xx xx xx
xx xx yy
oa ob oc od oe of og oh oi oj
xx xx xx xx xx xx xx xx xx xx xx xx xx xx
xx xx xx xx xx xx xx xx xx xx yy
ok ol om on oo op oq or os ot ou ov ow
oo oo oo oo oo oo oo oo oo oo oo oo oo
oo oo oo oo oo oo oo oo
oo oo oo oo oo oo oo oo oo oo oo oo oo
oo oo oo oo oo oo oo oo
oo oo oo oo oo oo oo oo oo oo oo oo oo
oo oo oo oo oo oo oo oo 



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Float-in-combination-with-linefeed-treatment-doubles-a-part-of-the-text-tp44068.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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