SVG file excessive white space

I’ve created a vector using Adobe Illustrator CS5. The actual size is supposedly 30×30 px. For some reason, whenever I save it as an SVG file. It produces a file that is not 30×30 px. My vector is in it (on the upper left) but it has a lot of whitespace that I just couldn’t figure how to remove.

  • I’ve already tried cleaning my vector, checking if there are stray elements possibly contributing to the bigger space.
  • Also tried every possible settings written out there but still couldn’t get the 30×30 that I want.

Here’s a screenshot of the saved file :
enter image description here

Here’s the actual SVG file :
http://katerinapetrova.com/11.svg

Answer

  • Select All (Cmd/Ctrl A)
  • Object > Artboards > Fit to Artwork Bounds
  • File > Save As
  • Format: SVG

This sets the origin to: x=”0px” y=”0px”

The viewBox to: “0 0 [Your image’s width] [Your image’s height] “

And “enable-background:new 0 0 [Your image’s width] [Your image’s height];”

Attribution
Source : Link , Question Author : mona , Answer Author : theship

Leave a Comment