SVG - viewBox
Hi,
I'm wondering if someone can clear this up for me? I've got a very simple file of a 400x400px Artboard with a single rectangle in it. When you copy a shape to your clipboard in Illustrator you get something like:
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In -->
<svg version="1.1" baseProfile="basic"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" width="141.7px" height="129.6px" viewBox="0 0 141.7 129.6" style="enable-background:new 0 0 141.7 129.6;"
xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;stroke:#000000;stroke-miterlimit:10;}
</style>
<defs>
</defs>
<rect x="0.5" y="0.5" class="st0" width="140.7" height="128.6"/>
</svg>
If you, using the same file/shape, go Save As... > Set Format to SVG (svg) > Hit Save > In the SVG Options hit 'SVG Code...'
You get:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" baseProfile="basic" id="Layer_1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 400 400"
xml:space="preserve">
<rect x="126.5" y="105" fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" width="140.7" height="128.6"/>
</svg>
What I'm interested in here is the viewBox attribute. On the clipboard this is set to viewBox="0 0 141.7 129.6" (i.e. the bounds of the shape(s)) but on the export you get viewBox="0 0 400 400" (i.e. the size of the artboard).
I've tried the different CSS Properties but it seems it's not possible to copy the Artboard size (viewBox) to the clipboard without going via Save As... Does anyone know any different?
Thanks,
Chris
Illustrator CC2017
OSX 10.11.6
