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 Mark Lennox <ML...@enghouse.com> on 2002/03/28 17:04:55 UTC

Modifying the DOM with SVGGenerator and Java2D?

Hi there,
 
I've been searching and trying a bunch of different things over the last
couple of days, and I can't seem to get the desired results.  Here is my
predicament:
 
I'm in a mapping situation, and I have a bunch of Java2D Shapes that I would
like to pass through the SVGGenerator to generate my SVG file via
SVGGraphics2D.stream().  However, I haven't quite figured out the best way
to modify the DOM so I can associate my own intelligent information with the
svg paths or even modify the DOM to change or add some SVG tags.  For
example, one thing I would like to add is the viewbox attribute.  Does
anyone know where I can find either a tutorial or a how-to for this?
 
Any hints would be greatly appreciated because I'm trying to come up with a
proof of concept to show off the advantages of on-the-fly, generated SVG.
 
Thanks in advance!
Mark Lennox


 <http://www.enghouse.com/> 

Software Development Specialist
direct: 905'946'3272
fax: 905'946'3201
web:  <http://www.enghouse.com/> www.enghouse.com

Applying Technology that WORKS
 

Re: Modifying the DOM with SVGGenerator and Java2D?

Posted by Vincent Hardy <vi...@sun.com>.
Mark,

You can have a look at:

http://xml.apache.org/batik/svggen.html
and at:

org.apache.batik.svggen.SwingSVGPrettyPrint.java as an example of 
adding your own information to the generated SVG.

Vincent.

> Mark Lennox wrote:
> 
> Hi there,
> 
> I've been searching and trying a bunch of different things over the
> last couple of days, and I can't seem to get the desired results.
> Here is my predicament:
> 
> I'm in a mapping situation, and I have a bunch of Java2D Shapes that I
> would like to pass through the SVGGenerator to generate my SVG
> file via SVGGraphics2D.stream().  However, I haven't quite figured out
> the best way to modify the DOM so I can associate my own intelligent
> information with the svg paths or even modify the DOM to change or add
> some SVG tags.  For example, one thing I would like to add is the
> viewbox attribute.  Does anyone know where I can find either a
> tutorial or a how-to for this?
> 
> Any hints would be greatly appreciated because I'm trying to come up
> with a proof of concept to show off the advantages of on-the-fly,
> generated SVG.
> 
> Thanks in advance!
> Mark Lennox
>                                Software Development Specialist
>    [Image]                                direct: 905'946'3272
>                                              fax: 905'946'3201
>                                          web: www.enghouse.com
>                 Applying Technology that WORKS
>

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