XSL:FO,在 FOP 中浮动
不久前我发现 FOP 不允许您使用浮点数以及 Xsl-Fo 1.0 中的一些其他功能。 我尝试了几种不同的方法来模仿他们,但没有成功。 如果有人在这方面取得了成功,或者有想法。 我真的很感激启发。
A while ago I found out that FOP doesn't allow you to use floats, and a few other features in Xsl-Fo 1.0. I've tried a few different ways to emulate them, but I have had no success. If anyone has had success in this, or has an idea. I would really appreciate enlightenment.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http://xmlgraphics.apache.org/fop/compliance.html 列出了哪些功能Apache FOP 支持 XSL-FO,哪些不支持。 浮动尚未实施。
http://xmlgraphics.apache.org/fop/compliance.html lists which features of XSL-FO are supported in Apache FOP and which are not. Floats have not been implemented, yet.
我知道这是一个老问题,但我遇到了同样的问题(我无法使用浮动,也无法升级到可以使用浮动的版本)。
我最终决定在两个文本块之间保留图像,前面的文本块带有
keep-with-next="always"
,图像后面的文本带有keep-with-previous="always" “
。我在此处在线找到了这些示例。 因此,文本不会环绕图像,但它位于图像的上方和下方(它适用于大图像,其中文本无论如何都不会环绕两侧,这就是我的情况,并且前面/后面的文本也不是太很多)。
I know this is an old question, but I had the same problem (I couldn't use float and also couldn't upgrade to a version where I could use float).
I finally settled on keeping an image between two text blocks, the preceding textblock with
keep-with-next="always"
and the text after the image withkeep-with-previous="always"
.I found these examples online here. So the text doesn't wrap around the image, but it's above and below the image (it works for large images where text wouldn't wrap around the sides anyway, which was my case, and the preceding/following text isn't too much).
大约晚了 4 年,但我已经设法通过一点……技巧让一张桌子漂浮起来。
这绝不是一个优雅或可靠的解决方案,但值得记住,以防您需要专门对齐表格。 类似的解决方案可能适用于空白块和保持在同一行的另一个块,但我没有在自己的使用中对此进行测试,因此您的结果可能会有所不同。
抱歉,我无法提供一般案例解决方案。
It's about 4 years late, but I've managed to get a Table to float right by a bit of...trickery.
By no means is this an elegant or reliable solution, but it's worth remembering, in case you ever need to align a table specifically. A similar solution might work with a blank block and another block made to stay on the same line, but I have not tested this in my own useage, so your results my vary.
Sorry I could not offer a general case solution.