Hi Sudhakar,

Sudhakar S <[EMAIL PROTECTED]> wrote on 05/23/2006 02:31:43 AM:

> > The width and height of the document is available from: 
> > Dimension2D BridgeContext.getDocumentSize() 
> > This is the 'size in pixels' of the rootmost SVG element, if it 
> > has width/height attributes, otherwise it is whatever is returned 
> > by batik.bridge.UserAgent.getViewportSize(). 
> 
> It is always returns height and width of the rootmost SVG element. But 
while
> zoomin/zoomout, it is not returning the exact scaled width and height
> values. Is there anyway to find scaled transfom's width and height?

   Who is zooming in and out, and how? 
   This is the print transcoder, isn't it?

> Earlier i used following code to find the scaled width and height using
> SVGCanvas. Is there anyother way to find it without SVGCanvas??

   I'm sure you can figure it out but since I don't know how you
zooming it's hard to provide help.  The basic idea should be the
same, some 'known' rectangle is being mapped to the device space
by an affine.

> GraphicsNode node = svgCanvas.getGraphicsNode();
> Rectangle2D viewRect = (Rectangle2D)node.getBounds().clone();
> AffineTransform vCoordi = _svgCanvas.getViewBoxTransform();
> final Rectangle docSize = vCoordi.createTransformedShape(new 
Rectangle(0, 0,
> (int)viewRect.getWidth(),
>                             (int)viewRect.getHeight())).getBounds();


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to