xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brigette Muller" <brigette_mul...@coxtarget.com>
Subject RE: Using URL rather than embedded PNG from SVGGraphics2D
Date Mon, 16 Jul 2001 20:34:40 GMT
Hi Thomas,

	I already had the images as jpeg, publicly accessible. Thanks to
your suggestion, I implemented a new ImageHandler which ignores the
images. A public method setCurrentURL(url) is called BEFORE the
g2.draw(), and the custom image handler writes the height, witdth etc
and adds the previously set URL as the xref link.

thanks again for pointing me in the right direction!

keep smiling
Brigette

-----Original Message-----
From: Thomas E Deweese [mailto:thomas.deweese@kodak.com]
Sent: Monday, July 16, 2001 12:43 PM
To: Batik Users
Subject: Using URL rather than embedded PNG from SVGGraphics2D


>>>>> "BM" == Brigette Muller <brigette_muller@coxtarget.com> writes:

BM> Hi all,

BM> 	Does anyone have an example of some code to create an SVG
BM> document with an image referenced by a URL, rather than an
BM> embedded png?

    [...]

BM> What I would like to do is on writing the image to the SVG,
BM> include the URL as above, not the embedded png. Any suggestions
BM> where to look?  tia Brigette

    You want to replace the default ImageHandlerBase64Encoder with
either ImageHandlerPNGEncoder or ImageHandlerJPEGEncoder.  This can be
done most simply in the constructor for SVGGraphics2D:

public SVGGraphics2D(Document domFactory,
                         ImageHandler imageHandler,
                         ExtensionHandler extensionHandler,
                         boolean textAsShapes)

    The interface and construction of the ImageHandlers is fairly
straight forward.

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


Mime
View raw message