XSL:FO,在 FOP 中浮动

发布于 2024-07-28 22:19:02 字数 108 浏览 7 评论 0原文

不久前我发现 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

-残月青衣踏尘吟 2024-08-04 22:19:02

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.

人间☆小暴躁 2024-08-04 22:19:02

我知道这是一个老问题,但我遇到了同样的问题(我无法使用浮动,也无法升级到可以使用浮动的版本)。
我最终决定在两个文本块之间保留图像,前面的文本块带有 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 with keep-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).

神魇的王 2024-08-04 22:19:02

大约晚了 4 年,但我已经设法通过一点……技巧让一张桌子漂浮起来。

fo:table width="15cm"
fo:table-column column-width="7cm"/
fo:table-column column-width="3cm"/
fo:table-column column-width="5cm"/
fo:table-row
fo:table-cell border="none"
[Intentionally left blank]
/fo:table-cell
fo:table-cell border="solid"
[Content of 3cm column]
/fo:table-cell
fo:table-cell border="solid"
[Content of 5cm column]
/fo:table-cell
/fo:table-row
/fo:table

这绝不是一个优雅或可靠的解决方案,但值得记住,以防您需要专门对齐表格。 类似的解决方案可能适用于空白块和保持在同一行的另一个块,但我没有在自己的使用中对此进行测试,因此您的结果可能会有所不同。

抱歉,我无法提供一般案例解决方案。

It's about 4 years late, but I've managed to get a Table to float right by a bit of...trickery.

fo:table width="15cm"
fo:table-column column-width="7cm"/
fo:table-column column-width="3cm"/
fo:table-column column-width="5cm"/
fo:table-row
fo:table-cell border="none"
[Intentionally left blank]
/fo:table-cell
fo:table-cell border="solid"
[Content of 3cm column]
/fo:table-cell
fo:table-cell border="solid"
[Content of 5cm column]
/fo:table-cell
/fo:table-row
/fo:table

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文