Hi Thomas,

> This is not necessarily the same as the viewBox rect.  This 
> is the actual bounds of the geometry which can be larger or 
> smaller than the rectangle specified by the viewBox attribute. 

Actually i didnt use viewBox attribute in my application. Because if use
viewBox attribute, SVGCanvas is not showing the exact size of the document.
Total SVG document is zoomed out to smaller size. But if i use other
editors(Internet Explorer) to open exported SVG file. Size is perfect. So
could you please explain how to show exact SVG Document with viewBox
attribute.

<svg contentScriptType="text/ecmascript" width="1019"
     xmlns:xlink="http://www.w3.org/1999/xlink"; zoomAndPan="magnify"
     style="cursor:url(#selCursor),crosshair" contentStyleType="text/css"
     height="663" viewBox="0 0 1019 663" preserveAspectRatio="none"
     xmlns="http://www.w3.org/2000/svg"; version="1.0">


> The batik.bridge.ViewBox class has a bunch of useful methods for 
> dealing with the viewBox (in particular parseViewBoxAttribute). 

> I would transform the real viewBox with the viewingTransform, 
> this should give you the proper width/height. 

I have used the following code to get zoomed in/zoomed out size of the
Document. But still i couldn't able to get the exact size. So can you please
give some more information to get proper width and height?

SVGSVGElement el = _document.getRootElement();
           String viewBoxStr = el.getAttributeNS(null,
SVGConstants.SVG_VIEW_BOX_ATTRIBUTE);
           float[] r = ViewBox.parseViewBoxAttribute(el, viewBoxStr);
           GraphicsNode gn = getGraphicsNode();
           CanvasGraphicsNode cgn = getCanvasGraphicsNode(gn);
           if (cgn != null) {
               AffineTransform vTx = cgn.getViewingTransform();
               final Rectangle docSize = vTx.createTransformedShape(new
Rectangle((int)r[0], (int)r[1], (int)r[2], (int)r[3])).getBounds();
               System.out.println("Doc Size::" + docSize);
           }


Thanks,
Sudhakar



-- 
View this message in context: 
http://www.nabble.com/Mismatch-in-Scale-value-tf1893554.html#a5215414
Sent from the Batik - Users forum at Nabble.com.


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

Reply via email to