2016-11-15 74 views
0

我有一个xsl文档,我需要有一系列页面,每个页面包含一个图像标题,然后在其下面有一个图像。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> 

和宽度/内容的宽度/高度/上的块和外部图形无济于事内容的高度的许多组合。大多数情况下,我会将图像垂直或水平地从页面溢出。

+0

指定您正在使用的格式化程序。 –

+0

在外部图形的fo:block上指定'width =“100%”height =“100%”'' –

回答

0

很可能需要将属性max-height和max-width添加到100%。

<fo:external-graphic content-width="scale-down-to-fit" width="100%" content-height="scale-down-to-fit" height="100%" scaling="uniform" max-width="100%" max-height="100%">