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 Peter Becker <pb...@meganesia.int.gu.edu.au> on 2001/06/01 10:13:41 UTC

Re: Embedded SVG

Thanks Roland,

this XMLC approach looks quite interesting (I should put it into my 
related projects links) but I approach this problem a slightly different 
way (at least my first impression is that I do so).

My program generates websites running a kind of compiler -- the output 
is (usually) plain HTML/PNG/JPG that can be uploaded on an ordinary HTTP 
server. I wrote this for my Sourceforge projects and my private Site -- 
in both cases I can't (and don't want to) run a Servlet Engine.

The way I realized the buttons is to include them into my website file 
(you can call it a makefile) and then extract this part and change the 
DOM before using Batik. I just look for <text> nodes with a specific 
[id] attribute and replace the text in them -- works fine so far. SVG 
Documents can be processed, too (they are just declared as SVG and Batik 
will be called to render them).

What I would like to do now is to support SVG in XHTML like it is done 
in Amaya (the W3C reference browser/editor). I'd like to have a switch 
in my makefiles that tells XWeb (my program) to search for embedded 
SVGs, render them as PNGs or JPGs and replace the embedded <svg> with an 
appropriate <img> element (using the DOM). It would be very nice to 
allow people to edit pages with Amaya and then to use XWeb to publish 
the results for browsers without SVG support. SVG on the client side has 
a lot of advantages but I don't want to rely on this yet so I try to 
implement some transitional solution.

Anyone working on this or similar?

   PeterB



Roland Schulz wrote:

> Hello,
> 
> I do similar things for generating buttons. But I don't embed the svg. 
> Instead I set the src attribute to the name of the svg file. When I display 
> the page, I rasterize the image and then replace the reference to the svg 
> file with a reference to the created image. I have also written a xmlc 
> extension for svg. This way it is extremly easy to make minor modifications 
> (e.g. setting the text of the button) befor rasterinzing. In case you are 
> intrested in this look at:
> http://xmlc.enhydra.org/project/mailingLists/xmlc/msg00872.html
> general xmlc infos: xmlc.enhydra.org
> 
> cu
> Roland Schulz
> Fahrenheit 451 neue Medien KG
> 
>> is there anyone rendering embedded SVG with Batik? I'd like to allow
>> <svg> elements in other formats (mainly XHTML) and would like to render
>> them into PNG/JPG for usage with an ordinary browser. My current concept
>> for this looks like this:
>> 
>> - read the XML input into DOM
>> - traverse DOM looking for <svg> elements (should I use the name or the
>> namespace to identify?)
>> - write all <svg>s into temporary files and rasterize them with Batik
>> (direct way still doesn't work. Any nice tricks for the filenames?)
>> - replace <svg> in original DOM with suitable <img> element
>> - proceed with XSLT (or should I first process the XSLT?)
>> 
>> Anyone doing similar things and/or interested in discussing this?
>> 
>> BTW (OT): does anybody know a nice MathML renderer for Java? --> mail me
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org




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