xsl-fo圖文混排的問題解決
用fop轉換fo文件到pdf遇到了很多奇奇怪怪的問題,插入圖片之後圖片總是在一行,而文字不能排在旁邊,效果很不好,查了很多資料,文檔裏有一個fo:float標籤可以用,但是w3c教程裏面又沒有說怎麼用,試了很多回直接連圖片都不顯示 …最後用谷歌搜索才搜出了一個給了很多實例的網站,對照着上面的例子才發現臥槽float原來是用start,end標示位置不是用left,right啊 = =
<fo:block space-before="0.5em" space-after="0.5em">
<fo:float float="start">
<fo:block start-indent="0cm" end-indent="0cm" border=".1pt solid red" color="blue">
<fo:external-graphic src="url('img/dtp-xsl.emf')" width="5cm" height="3.5cm" content-width="4.5cm" content-height="3.0cm" display-align="center" text-align="center"/>
<fo:block/>
Image 1: image inside the side float
</fo:block>
</fo:float>
An image is inserted at the beginning of the paragraph as fo:float.
</fo:block>