Documents that are created using the Web new document preset export SVGs from documents that are created using the Print new document preset:
1. Create a new Illustrator file using the Mobile, Web, File & Video Blank Document Presets:
2. Draw a rectangle.
3. In layers pane change <Rectangle> name to center, middle.
4. Export as SVG and press the export button
5. Press the Show Code button and you will see the code:
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="318" height="253" viewBox="0 0 318 253">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<g id="center_middle" data-name="center, middle">
<rect class="cls-1" x="0.5" y="0.5" width="317" height="252"/>
<path d="M437,129V380H121V129H437m1-1H120V381H438V128Z" transform="translate(-120 -128)"/>
</g>
</svg>
Note that the <rect> element is within a <g> element with the center, middle label defined.
The Print or Art & Ilustration export of SVG is done by:
1. Create a new illustrator file using the Print or Art & Illustration Blank Document Presets.
2. Draw a rectangle.
3. In layers pane change <Rectangle> name to center, middle.
4. Export as SVG and press the export button
5. Press the Show Code button and you will see the code:
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="157.25" height="157.25" viewBox="0 0 157.25 157.25">
<defs>
<style>
.cls-1 {
fill: #fff;
stroke: #231f20;
stroke-miterlimit: 10;
}
</style>
</defs>
<rect class="cls-1" x="0.5" y="0.5" width="156.25" height="156.25"/>
</svg>
I don't understand why there is a difference in the export of the SVG depending on the type of illustrator document created? Any comments or insights?
I still don't have a why on this difference in SVG behaviour. I'm going to send out a query on this.