By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

Text Boundings Box with Batik

P: n/a
Hello,

I am creating a application with Batik and I have the following
problem. I am buidling a DOM Tree and I want to know the bounding box
of the text-Elements while I am building the DOM. I need that
information, because I want to create a fitting rect as a background
for every Text-Element and for other layout-reasons.

Can someone help me? I already searched in the Batik mail-archive, but
didn't find a solution for my problem.
Here is my code:

DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
SVGOMDocument doc = (SVGOMDocument)impl.createDocument(svgNS, "svg",
null);

Element text = doc.createElementNS(svgNS,"text");
Text textNode = doc.createTextNode("a text");
text.appendChild(textNode);

// here I want to know the bounding box

Possible?

Thank you,

Tjorven Lauchardt
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.