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 Jonathan Powell <jp...@jpowell.co.uk> on 2005/12/28 13:41:34 UTC

Converting svg to png/jpg inline.

Hi,

Ideally I would like to use the Rasterizer to convert svg on stdin to 
png on stdout for use in a webapplication that will dynamically generate 
png's from svg code itself dynamically generated from user input. As it 
stands the Rasterizer works on files saved on the filesystem.

Have any other users found a solution for a problem like this, if so I 
would appreciate any help.

Regards,

Jonathan Powell

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


Re: Converting svg to png/jpg inline.

Posted by Ionut Ciocirlan <io...@avandor.com>.
The rasterizer is just a command-line application using Batik's Transcoder, 
which you'll need to use as well.

See the Transcoder API and the example there --  
http://xml.apache.org/batik/rasterizerTutorial.html#createImage

Simply feed an io.StringReader as TranscoderInput, and an 
io.ByteArrayOutputStream as TranscoderOutput.
You'll get the binary image from output.toByteArray().

Ionut

----- Original Message ----- 
From: "Jonathan Powell" <jp...@jpowell.co.uk>
To: <ba...@xmlgraphics.apache.org>
Sent: Wednesday, December 28, 2005 2:41 PM
Subject: Converting svg to png/jpg inline.


| Hi,
|
| Ideally I would like to use the Rasterizer to convert svg on stdin to
| png on stdout for use in a webapplication that will dynamically generate
| png's from svg code itself dynamically generated from user input. As it
| stands the Rasterizer works on files saved on the filesystem.
|
| Have any other users found a solution for a problem like this, if so I
| would appreciate any help.
|
| Regards,
|
| Jonathan Powell
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
| For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org 


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