XSL FO内联对齐 [英] XSL FO inline alignment

查看:82
本文介绍了XSL FO内联对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使文本在同一行上左右对齐.这应该是可能的,但是我似乎找不到办法.我正在使用Apache FOP将xml转换为pdf.

I need to get text aligned right and left on the same line. This should be possible, but i can't seem to find a way. I'm using Apache FOP to convert xml to pdf.

有人可以帮我解决这个问题吗?

Can someone help me to get this right?

推荐答案

优雅不是明确的要求,但这应该符合要求:

Elegance wasn't a stated requirement, but this should fit the bill:

<fo:block text-align-last="justify">
  LEFT TEXT
  <fo:leader leader-pattern="space" />
  RIGHT TEXT
</fo:block>

这可以通过对齐块中文本的最后一行来工作,以便文本从该行的左侧开始,在右侧结束.通常在目录"页面上使用的领导者会拉伸以填充左右文本之间的空间.通常,它用作<fo:leader leader-pattern="dots" />,它会产生一段周期,但是在这种情况下,它仅提供了一小部分空间.

This works by justifying the last line of text in the block, so that the text begins at the left of the line and ends at the right. The leader, which is usually used on Table of Contents pages, stretches to fill the space between the left and right text. Normally it is used as <fo:leader leader-pattern="dots" />, which produces a stretch of periods, but in this case it merely provides a gulf of space.

这篇关于XSL FO内联对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆