与FOP的背景图像的文本

时间:2015-04-07 09:11:53

标签: xslt xsl-fo apache-fop

我正在使用FOP api和XSL生成PDF。

我的要求是在背景图像上面写一些文字。建议的任何可行方式都会有所帮助。

1 个答案:

答案 0 :(得分:2)

您可以使用background-image属性:

<fo:block background-image="image.png">Lorem ipsum.</fo:block>

您可以使用background-repeatbackground-position-horizontalbackground-position-vertical来控制图像的重复和位置:

<fo:block background-image="image.png" background-repeat="no-repeat">Lorem ipsum.</fo:block>

<fo:block background-image="image.png" background-repeat="no-repeat" background-position-horizontal="center">Lorem ipsum.</fo:block>