开发者

how to get transforming XML with SVG graphics to PDF work?

开发者 https://www.devze.com 2023-02-11 02:53 出处:网络
Hi I\'ve tried to find an answer to problem without success, and need your help. I have XML and XSL files which I simply run with XSL Transform in Eclipse with no problems at all. But when I try to r

Hi I've tried to find an answer to problem without success, and need your help.

I have XML and XSL files which I simply run with XSL Transform in Eclipse with no problems at all. But when I try to render that XML file just created to PDF with Apache FOP 0.95 in Eclipse I encounter a problem.

How do I correctly use SVG graphics in XSL?

I'm using SVG playing cards (http://svg-cards.sourceforge.net) and trying to get a card to render to my final PDF. The readme only says

...can access by using their name with a DOM interface. All cards are inside a SVG group. Example: the king of spade is inside this group: <g id="king_spade">

When I'm using the code below, I'm getting an error:

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-开发者_C百科object xmlns:svg="http://www.w3.org/2000/svg">
    <svg width="20" height="20">
        <svg:g id="king_spade" />
    </svg>
</fo:instream-foreign-object>

I know this code is way wrong but I have just started to play with XML/XSL so, please, be gentle. Thanks in advance.


Have you tried the suggestions in this discussion?

http://old.nabble.com/unable-to-insert-images%3A-no-imagepreloader-found-to25698514.html#a28111612

Also have you tried to test it with an external SVG test image with just the '<fo:external-graphic src="test.svg" />' instruction?

0

精彩评论

暂无评论...
验证码 换一张
取 消