我正在使用FOP api和XSL生成PDF。
我的要求是在背景图像上面写一些文字。建议的任何可行方式都会有所帮助。
答案 0 :(得分:2)
您可以使用background-image
属性:
<fo:block background-image="image.png">Lorem ipsum.</fo:block>
您可以使用background-repeat
,background-position-horizontal
和background-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>