Mayur,

You can turn your string into an SVGDocument and then use the 
setSVGDocument method on JSVGComponent.

To find out how to build a document from your string, see:

http://xml.apache.org/batik/domapi.html

there is a section on "Creating a Document from a SVG file" which is
the same code you can use for building from a String, except that you'll
have to use createDocument(uri, reader) instead of the straight
uri based createDocument.

I have attached a quick code example.

I hope this helps,
Vincent.

Mayur Agrawal wrote:
> 
> Hi All,
> 
>         I want to display a SVG using batik api.
>         So for the purpose we are using JSVGComponent from
> org.apache.batik.swing.svg.JSVGComponent
> 
>         Right now we are using the following technique
> 
>                 JSVGComponent svgcomp=new JSVGComponent();
> 
> svgcomp.loadSVGDocument("file://r2deploy/ProcessChem/svg/compounds/596.svg")
> ;
> 
>         This works very fine, but we are in need of a method in batik API,
> which uses String parameter (an SVG String), which will
>         directly take a SVG String as a parameter and display it.
> 
>         So we wanted to know,
>                 Do we have an option for this purpose ?
> 
>         Please help and guide for the same
> 
> Regards
> Mayur
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Attachment: DOMTest.java
Description: application/unknown-content-type-javafile

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  • urgent! Mayur Agrawal
    • Vincent Hardy

Reply via email to