You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Marc Collin <co...@laboiteaprog.com> on 2006/08/06 03:00:23 UTC

no able to display svg image

hi

i try to display a svg image on a panel

imgPane.setImgFile(new 
File("/home/test/workspace/Jono/picture/education/crayon.svg"));
imgPane.displayImg();


public void setImgFile(File imgFile) {
  this.imgFile = imgFile;
}

public void displayImg(){
  svgCanvas.setURI(getImgFile().toString());


i get this error



java.io.IOException: Unable to make sense of URL for connection
	at org.apache.batik.util.ParsedURLData.openStreamInternal(Unknown Source)
	at org.apache.batik.util.ParsedURLData.openStream(Unknown Source)
	at org.apache.batik.util.ParsedURL.openStream(Unknown Source)
	at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown 
Source)
	at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocument(Unknown 
Source)
	at org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown Source)
	at org.apache.batik.swing.svg.SVGDocumentLoader.run(Unknown Source)


any idea?


thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: no able to display svg image

Posted by th...@kodak.com.
Hi Marc,

Marc Collin <co...@laboiteaprog.com> wrote on 08/05/2006 09:00:23 PM:

> public void setImgFile(File imgFile) {
>   this.imgFile = imgFile;
> }
> 
> public void displayImg(){
>   svgCanvas.setURI(getImgFile().toString());

   The Canvas wants a URI/URL not a local file system reference
so you should use the 'FILE.toURL().toString()'

> java.io.IOException: Unable to make sense of URL for connection


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org