2011-02-15 149 views
0

嗨我試圖找到一個沒有成功的問題的答案,並需要你的幫助。如何使用SVG圖形將PDF轉換爲PDF文件?

我有XML和XSL文件,我只是簡單地在Eclipse中使用XSL Transform運行,根本沒有任何問題。但是當我嘗試在Eclipse中使用Apache FOP 0.95將該XML文件創建爲PDF時,我遇到了一個問題。

如何在XSL中正確使用SVG圖形?

我正在使用SVG撲克牌(http://svg-cards.sourceforge.net)並試圖獲取一張卡來呈現我的最終PDF。自述文件只說

...可以通過使用它們的名稱與DOM接口進行訪問。所有卡都在SVG組內。例如:黑桃王是該組中:<g id="king_spade">

當我用下面的代碼,我得到一個錯誤:

Image not available: No ImagePreloader found for svg-cards.svg Unknown formatting object ^svg Intrinsic dimensions of instream-foreign-object could not be determined

<fo:external-graphic src="svg-cards.svg" /> 
    <fo:instream-foreign-object xmlns:svg="http://www.w3.org/2000/svg"> 
    <svg width="20" height="20"> 
     <svg:g id="king_spade" /> 
    </svg> 
</fo:instream-foreign-object> 

我知道這個代碼是這樣不對,但我剛剛開始使用XML/XSL,所以請溫和。提前致謝。

回答