xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron McCormack <...@mcc.id.au>
Subject Re: Manipulation of existing svg document
Date Wed, 28 May 2008 08:17:52 GMT
Lars Eirik Rønning:
> Thanks for helping.
> I actually wish to only open the file and get its base64encoding. Note that
> in my case i do not have  bufferedImage, i merely wish to open the fileURI
> and have the bytes encoded to base64.
> I have found a base64Enocder class which may be used (org.apache.codec)

I’m not sure which class you are referring to here.  (Batik doesn’t have
a class called Base64Encoder.)

> As i understand it the Base64EncoderStream class in Batik requires an
> renderedImage as input, but this is not what i am looking at.

No, it doesn’t (PNGImageEncoder does).  You can write whatever bytes you
like to a Base64EncoderStream and it will output them as the base 64
bytes.  So it sounds like you just want to open a FileInputStream and
feeds its bytes to a Base64EncoderStream.

> If i also understand you correct, the transform element is not required in
> order for an image to appear, only if i wish to do some transformation to
> the image, such as translating it or skewing and so forth.

That’s right.  You will have to give it a width="" and height=""
attribute (and probably an x="" and y="", too) to tell it where in your
document it should render.

-- 
Cameron McCormack ≝ http://mcc.id.au/

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


Mime
View raw message