Scaling an SVG in Java

馋奶兔 提交于 2019-12-03 11:20:46

If you don't set the KEY_AOI transcoding hint, then the viewBox="" attribute on the root <svg> element will be used to determine the area of interest. If the document you are transcoding doesn't have have a viewBox="" attribute, then the width="" and height="" attributes will be used, so the AOI will be (0, 0, width, height).

And if none of these are set, and you don't know in advance where within the document's coordinate system the graphics are, then you could compute the bounding box of the root <svg> element and use that as the AOI. You could do this by first "booting the DOM" for your document, and then calling getBBox() on the document element.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!