You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Fei chang <fe...@gmail.com> on 2008/05/12 16:48:45 UTC

convert svg to other format picture

Hi all,

I am using Batik for converting svg to other format picture. 
That format is defined by myself. 
Is it possible ? any idea.
Thanks a lot ....
 Fei Chang
-- 
View this message in context: http://www.nabble.com/convert-svg-to-other-format-picture-tp17189094p17189094.html
Sent from the Batik - Dev mailing list archive at Nabble.com.


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


Re: convert svg to other format picture

Posted by Fei chang <fe...@gmail.com>.
hello,
I am very grateful for your suggestions.Could you send some resources about
converting to vector format to me, my email : fei80230901@gmail.com
Thanks again


Fei Chang

Hello,

Yes it is possible, even if Batik does not help a lot for Vector images 
(new raster formats seem to be very simple to transcode to, if you are 
able to write a File of your format of choice with a BufferedImage).

For Vector formats: You can subclass the SVGAbstractTranscoder class to 
make Batik writing in a Graphics2D pipeline (you can borrow some code 
from ImageTranscoder. Then you "only" need to write another Graphics2D 
subclass to output to your format. You may even be able to keep the 
structure of the original SVG document, if you format also has a nested 
structure. I wrote several transcoders this way from SVG to specific 
proprietary formats and it worked well for me.

Thinking about that, I should send a patch with an abstract subclass of 
SVGAbstractTranscoder which takes care of some of the dirty work 
(approx. 800 lines, but I'm sure it could have been shorter). Maybe it 
could be useful to somebody apart from me, after all ;-)

Hervé Girod

-- 
View this message in context: http://www.nabble.com/convert-svg-to-other-format-picture-tp17189094p17312196.html
Sent from the Batik - Dev mailing list archive at Nabble.com.


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


Re: convert svg to other format picture

Posted by Hervé Girod <he...@club-internet.fr>.
Hello,

Yes it is possible, even if Batik does not help a lot for Vector images 
(new raster formats seem to be very simple to transcode to, if you are 
able to write a File of your format of choice with a BufferedImage).

For Vector formats: You can subclass the SVGAbstractTranscoder class to 
make Batik writing in a Graphics2D pipeline (you can borrow some code 
from ImageTranscoder. Then you "only" need to write another Graphics2D 
subclass to output to your format. You may even be able to keep the 
structure of the original SVG document, if you format also has a nested 
structure. I wrote several transcoders this way from SVG to specific 
proprietary formats and it worked well for me.

Thinking about that, I should send a patch with an abstract subclass of 
SVGAbstractTranscoder which takes care of some of the dirty work 
(approx. 800 lines, but I'm sure it could have been shorter). Maybe it 
could be useful to somebody apart from me, after all ;-)

Hervé Girod

Fei chang wrote:
> Hi all,
>
> I am using Batik for converting svg to other format picture. 
> That format is defined by myself. 
> Is it possible ? any idea.
> Thanks a lot ....
>  Fei Chang
>   

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