Andres Toussaint wrote:
My Main question is: How is the best way to add this image into my document?
Encode it as a PNG and include it in the xlink:href using the data protocol. This is what the code below does (very indirectly).
The code to do this more directly (take from batik.svggen.ImageHandlerBase64Encoder) is something like:
public static final String DATA_PROTOCOL_PNG_PREFIX = "data:image/png;base64,";
ByteArrayOutputStream os = new ByteArrayOutputStream(); Base64EncoderStream b64Encoder = new Base64EncoderStream(os);
ImageEncoder encoder = new PNGImageEncoder(b64Encoder, null); encoder.encode(buf);
// Close the b64 encoder stream (terminates b64 streams). b64Encoder.close();
imageElement.setAttributeNS(XLINK_NAMESPACE_URI, ATTR_XLINK_HREF, DATA_PROTOCOL_PNG_PREFIX + os.toString());
Also, will doing this approach create a Embedded Image in my SVG? Or how is the reference to the Image handled? What format of image will be embedded (PNG, JPG,...)?
The above will embed the image in the SVG.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]