Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » SVG field external link
SVG field external link [message #997252] Fri, 04 January 2013 12:40 Go to next message
Li Hao is currently offline Li Hao
Messages: 28
Registered: August 2011
Junior Member
I am trying the SVG field, it is able to display svg file, but if the svg file contains external link to image file or other svg files, it does not show up. for example, I have this sample svg file:

========================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve" viewBox="0 0 2155 1733"
preserveAspectRatio="xMidYMid meet">
<g id="bitmap" style="display:online">
<image x="0" y="0" width="2155" height="1733" xlink:href="C:/development/scout-workspace-juno/svg/test.jpg"/>
</g>
<g id="PajekSVG" style="display:online">
<g transform="translate(100 50)">
<g transform="scale(0.7)">
<image x="0" y="0" width="493" height="533" xlink:href="C:/development/scout-workspace-juno/svg/test.svg"/>
</g>
</g>
</g>
</svg>
========================================================================

but it does not show up in the form. If I point the svg file to the file: C:/development/scout-workspace-juno/svg/test.svg

The content of test.svg:

========================================================================
<?xml version="1.0"?>
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<g>
<title>Layer 1</title>
<rect id="svg_1" height="26" width="43" y="160" x="177" stroke-width="5" stroke="#000000" fill="#ddbaba"/>
</g>
</svg>
========================================================================

and this layer of svg content is able to show up properly in the form, but of course without the image background.

I have tested the sample svg in browser and it show up properly with both image and svg layer. How to get this working with scout?
Re: SVG field external link [message #997268 is a reply to message #997252] Fri, 04 January 2013 15:39 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat Schwarzentrub
Messages: 43
Registered: November 2010
Member
Scout uses Apache Batik to render SVG graphics. As with other formats, rendering results are implementation dependent. So if a file looks good in Internet Explorer it must not necessarily look the same in Batik and vice versa.

In your case, try to use proper URLs to point to your images, e.g. file:///C:/development/scout-workspace-juno/svg/test.jpg. This did the trick for me.

If you are unsure if the problem is located in Scout or in Batik, you can download a simple SVG viewer from the Batik website. Download the binary distribution and run batik.jar. You can then load your SVG image and check if it renders correctly.

Beat
Re: SVG field external link [message #997292 is a reply to message #997268] Fri, 04 January 2013 19:38 Go to previous message
Li Hao is currently offline Li Hao
Messages: 28
Registered: August 2011
Junior Member
I change it to file:/// and it works great. Thank you very much.
Previous Topic:Max Fraction Digits stuck at 2
Next Topic:Tomcat
Goto Forum:
  


Current Time: Thu Aug 28 21:38:43 EDT 2014

Powered by FUDForum. Page generated in 0.01691 seconds