I've created a vector using Adobe Illustrator CS5. The actual size is supposedly 30x30 px. For some reason, whenever I save it as an SVG file. It produces a file that is not 30x30 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 30x30 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

  • Could you post the SVG file for us to have a look at please? Commented May 26, 2016 at 9:21
  • Hi Jackson! I've pasted the link of the svg file above. SVG is not allowed to be uploaded here. thanks!
    – mona
    Commented May 26, 2016 at 9:34
  • 1
    I opened your SVG and it looked fine to me (here's a screenshot). I'm not sure how you're getting such a large amount of white space around the shape in yours.
    – Manly
    Commented May 26, 2016 at 18:28
  • 2
    How are you previewing that SVG? Commented May 27, 2016 at 13:08

2 Answers 2

  • 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];"

  • Thanks, you saved me hours! Commented Nov 14, 2019 at 16:03
  • Not working in my case :( Commented Jun 23, 2020 at 9:57

I had issues with excess white space above and below my SVGs on a pdf editor and tried theship's suggestion and that got me halfway to my goal. The other part that was messing me up was the auto-checked "Responsive" checkbox in the SVG save as dialog box. Unchecking that box put the SVG up at the top of the document without white space. Provided, I was using 2018's version of Illustrator CC.

  • Welcome to GD.SE!
    – Mensch
    Commented Oct 24, 2018 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.