【发布时间】:2016-11-15 21:01:09
【问题描述】:
我有一个 xsl 文档,我需要在其中包含一系列页面,每个页面包含一个图像标题,然后在其下方有一个图像。
我不提前知道确切的图像尺寸,但我希望标题出现在页面顶部,然后将图像限制为不大于页面高度的剩余部分或宽度页面(如果需要,统一缩放)。
我试过了
<fo:block>
<fo:block>Image Caption Here</fo:block>
<fo:block>
<fo:external-graphic content-width="scale-down-to-fit" width="100%" content-height="scale-down-to-fit" height="100%" scaling="uniform">
</fo:block>
</fo:block>
并且块和外部图形上的宽度/内容宽度/高度/内容高度的许多组合都无济于事。大多数情况下,我的图像会垂直或水平溢出页面。
【问题讨论】:
-
指定您使用的格式化程序。
-
在外部图形周围的 fo:block 上指定
width="100%" height="100%"