|
Thanks Javid and Thomas for the replies, Have got it working now after reading your suggestions.... just to
close the thread in case anyone else is looking for similar in the future,
required code looks something like this (of course adding the flushing/closing
of streams)..... TranscoderInput input = new TranscoderInput(doc); OutputStream ostream = new ByteArrayOutputStream(); TranscoderOutput output = new TranscoderOutput(ostream); t.transcode(input, output); ByteArrayOutputStream result =
(ByteArrayOutputStream)output.getOutputStream(); byte[] bytes = result.toByteArray(); Thanks as ever for the help, Cheers, Dylan. -----Original Message----- Hi Dylan, "Dylan Browne" <[EMAIL PROTECTED]> wrote on
06/19/2006 07:25:57 AM: > I was looking for way to improve my code where I stream an SVG
Document > (created using Batik DOM) to a browser. So basically I need to get
from SVG > Document to a byte[] which can be passed via Servlet which sets
the Mime type, > and so displayed. Well the transcoder can take _any_ OutputStream. Usually the servlet provides an output stream that could be passed directly to the Transcoder. Alternately you can use java.io.ByteArrayOutputStream which simply stores all the content in memory which you can retrieve as a byte[]. > Currently I use my method below, but as part of this method I am creating a > file object and retrieving my byte[] from that. Ideally (it may
actually > become a requirement) I?d like to avoid this step and be able to retrieve a > byte[] without creating a file object. > OutputStream ostream = new FileOutputStream("c:\\out."
+ mimeType); > TranscoderOutput output = new
TranscoderOutput(ostream); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:
[EMAIL PROTECTED] |
- scaling the document itself, not the image on display kloassie
- Re: scaling the document itself, not the image on d... Tonny Kohar
- Streaming SVG Document without creating temporary f... Dylan Browne
- RE: Streaming SVG Document without creating tem... Javid Alimohideen
- Re: Streaming SVG Document without creating tem... thomas . deweese
- RE: Streaming SVG Document without creating... Dylan Browne
- How to rotate a complete SVG ? Maik Schürer
- Re: How to rotate a complete SVG ? André Ávila
- RE: How to rotate a complete SVG ? sugawara
