我有以下svg文件。当我将其插入Powerpoint时,图像的右侧和底部都有很多空白。
我可以使用inkscape --query-all file.svg
来确定边界框。然后将viewBox="10.5 1 45 64"
添加到<svg ...>
标记中。这将删除边距。
有人知道自动添加此viewBox的方法吗?
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path d="M48.7,55c-0.4,0.4-0.4,1,0,1.4c0.4,0.4,1,0.4,1.4,0c0.4-0.4,0.4-1,0-1.4C49.8,54.7,49.1,54.7,48.7,55z"/>
<path d="M44.6,56.1c-0.4,0.4-0.4,1,0,1.4c0.4,0.4,1.1,0.4,1.4,0c0.4-0.4,0.4-1,0-1.4C45.7,55.7,45,55.7,44.6,56.1z"/>
<path d="M50.2,43.4c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1.1-0.4-1.4,0c-0.4,0.4-0.4,1,0,1.4C49.1,43.8,49.8,43.8,50.2,43.4z"/>
<path d="M46,44.4c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0c-0.4,0.4-0.4,1,0,1.4C45,44.8,45.7,44.8,46,44.4z"/>
<path d="M50.2,29.9c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0c-0.4,0.4-0.4,1,0,1.4C49.1,30.3,49.8,30.3,50.2,29.9z"/>
<path d="M46,31c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0c-0.4,0.4-0.4,1,0,1.4C45,31.3,45.6,31.3,46,31z"/>
<path d="M50.2,18.8c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0c-0.4,0.4-0.4,1,0,1.4C49.1,19.2,49.8,19.2,50.2,18.8z"/>
<path d="M46,19.8c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0c-0.4,0.4-0.4,1,0,1.4C45,20.2,45.7,20.2,46,19.8z"/>
<path d="M55.5,7.8C55.5,3.3,44.2,1,33,1C21.8,1,10.5,3.4,10.5,7.9c0,0,0,0,0,0c0,11,0,38.4,0,50.2c0,4.5,11.3,6.9,22.5,6.9 c11.2,0,22.5-2.4,22.5-6.9L55.5,7.8C55.5,7.9,55.5,7.8,55.5,7.8z M53.5,20.4C53.5,20.4,53.5,20.4,53.5,20.4c0,2-8,4.9-20.5,4.9 c-12.5,0-20.5-2.9-20.5-4.8v-9.6c3.7,2.5,12.2,3.9,20.5,3.9c8.4,0,16.8-1.3,20.5-3.9V20.4z M33,27.3c8.4,0,16.8-1.3,20.5-3.9V33 c0,0,0,0,0,0c0,2-8,4.9-20.5,4.9c-12.5,0-20.5-2.9-20.5-4.8v-9.6C16.2,26,24.6,27.3,33,27.3z M12.5,36c3.7,2.5,12.2,3.9,20.5,3.9 c8.4,0,16.8-1.3,20.5-3.9v9.5c0,0,0,0,0,0c0,2-8,4.9-20.5,4.9c-12.5,0-20.5-2.9-20.5-4.8V36z M33,3c12.5,0,20.5,2.9,20.5,4.9 c0,2-8,4.9-20.5,4.9c-12.5,0-20.5-2.9-20.5-4.8v0c0,0,0,0,0,0C12.5,5.9,20.5,3,33,3z M33,63c-12.5,0-20.5-2.9-20.5-4.9v-9.6 c3.7,2.5,12.2,3.9,20.5,3.9c8.4,0,16.8-1.3,20.5-3.9v9.6C53.5,60.1,45.5,63,33,63z"/>
</svg>