XSL-FO 静态图像位于文档左下角,动态文本围绕 2 列布局流动?
我正在使用来自外部源的动态 XML/XSL-FO 创建 PDF, 我需要页面左下角的图像,但它不起作用并且文本围绕图像流动。
使用的 xsl 如下 - 注意,flower 是对 fo:instream-foreign-object 作为 SVG 的片段的调用
<fo:flow flow-name="xsl-region-body">
<xsl:variable name="header" select="descendant-or-self::*[@id='prop_header']"/>
<xsl:variable name="title" select="substring-before($header,'-')"/>
<xsl:variable name="price" select="substring-after($header,'-')"/>
<fo:block xsl:use-attribute-sets="address"><xsl:value-of select="$title"/></fo:block>
<fo:block space-after="5mm" xsl:use-attribute-sets="innerprice"><xsl:value-of select="$price"/></fo:block>
<fo:block>
<fo:float float="left" width="61mm" clip="2mm" padding="1mm"
border-color="$grey" border-width="0">
<fo:block-container padding="0pt" margin="0pt" absolute-position="absolute" top="{$bleed + 200}mm" left="0mm" >
<xsl:call-template name="flower">
<xsl:with-param name="width">61</xsl:with-param>
<xsl:with-param name="height">49</xsl:with-param>
</xsl:call-template>
</fo:block-container>
</fo:float>
</fo:block>
图像显示在底部,但文本一直推到页面右侧(在 61mm 处) - 如果我将宽度设置为“1mm”,它可以工作,但文本会溢出图像。)
我怎样才能将图像放在正确的位置并且文本环绕,文本也是可变的并且可以改变图像内联的位置文本的内容是无法计算的。
I am creating a PDF using dynamic XML/XSL-FO from external source,
I need an image bottom left of the page but its not working and flowing the text around the image.
The xsl used is as follows - note flower is a call to a snippet of fo:instream-foreign-object as an SVG
<fo:flow flow-name="xsl-region-body">
<xsl:variable name="header" select="descendant-or-self::*[@id='prop_header']"/>
<xsl:variable name="title" select="substring-before($header,'-')"/>
<xsl:variable name="price" select="substring-after($header,'-')"/>
<fo:block xsl:use-attribute-sets="address"><xsl:value-of select="$title"/></fo:block>
<fo:block space-after="5mm" xsl:use-attribute-sets="innerprice"><xsl:value-of select="$price"/></fo:block>
<fo:block>
<fo:float float="left" width="61mm" clip="2mm" padding="1mm"
border-color="$grey" border-width="0">
<fo:block-container padding="0pt" margin="0pt" absolute-position="absolute" top="{$bleed + 200}mm" left="0mm" >
<xsl:call-template name="flower">
<xsl:with-param name="width">61</xsl:with-param>
<xsl:with-param name="height">49</xsl:with-param>
</xsl:call-template>
</fo:block-container>
</fo:float>
</fo:block>
The image displays at the bottom but the text is pushed to the right all the way down the page, (at 61mm - if i make the width="1mm" it works but the text overflows the image.)
How can i have the image in the correct place and the text wrap around, also the text is variable and can change so position of the image inline of the text is impossible to calculate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要你用了FOP,就不行了。不支持
fo:float
格式化对象。请参阅http://xmlgraphics.apache.org/fop/compliance.html# fo-对象浮动。As long as you use FOP, it won't work. The
fo:float
formatting object is not supported. See http://xmlgraphics.apache.org/fop/compliance.html#fo-object-float.