// get the 'width' and 'height' attributes of the SVG document
width = (int) (ctx.getDocumentSize().getWidth() + 0.5);
height = (int) (ctx.getDocumentSize().getHeight() + 0.5);
SpriteGraphics2D swf2d = new SpriteGraphics2D(width, height);
gvtRoot.paint(swf2d);
tags = swf2d.getTags();
//Override width and height based on the SWF-specific bounds of the sprite contents
//However we have to correct co-ordinates back to pixels... TODO: Remove all TWIPS references!
Rect bounds = swf2d.getBounds();
width = (int)Math.rint((bounds.xMax - bounds.xMin)/20.0);
height = (int)Math.rint((bounds.yMax - bounds.yMin)/20.0);
}