2016-11-15 71 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%">