Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

Consider the following two images:

enter image description hereenter image description here

The second image is my desired result: the artboard dimensions perfectly match the layer/selection/content. However, I had to resize the artboard manually. Is there a way to do this automatically? Ultimately I'm saving the file as an SVG. Rather than resizing the artboard, is there some setting that tells illustrator to export a file with the final dimensions being the size of the content or selection? Some googling suggests that this was possible in CS3 using Save for Web, but I didn't see any option like this in CS6.

share|improve this question

3 Answers 3

up vote 23 down vote accepted

Simply select the art work then choose Object > Artboards > Fit to Artwork Bounds from the menu. Assign a custom shortcut to that command if you use it often.

share|improve this answer
    
Giving this the answer since it provides the most convenient way to achieve this (especially by assigning a keyboard shortcut). Thanks! –  maxedison Aug 29 '12 at 17:09
    
Shame there's no option to add a buffer around the artwork/selection that the artboard fits itself to. INstead you have to manually add a box for this and then deleat it. –  geotheory Mar 3 at 12:29

I've had a similar problem. I typically create 20-60 icons for any given project. And because of that I create x-amount of evenly spaced artboards at the beginning of each project.

When I'm at a point that I'm ready to export my .ai icons to svgs I:

  1. First export each individual artbaord as an .eps (export these into a unique folder).
  2. Then I run a batch action to the .eps folder that 'Fits to Artwork Bounds' (crops all .eps artboards perfectly around the artwork.)
  3. Lastly I run one last batch action that saves all of the cropped .eps files and saves them as .svgs.

Takes three steps but is still pretty fast.

Hope that helps!!!

share|improve this answer

In CS5, you can just click the object with the Artboard Tool and an artboard will be created around it. (You can then click the original artboard and delete it if it's in your way.) Is that doable in CS6?

In Save for Web for CS6, look in the Image Size section on the right and you should see a checkbox to "Clip to Artboard." Toggle that to see how it goes from exporting based on the artboard size vs the dimensions of all objects in the workspace.

But that won't help you export SVG. I didn't see anything in SVG export settings that lets you crop to artwork rather than artboard. This could be possible with scripting? But I didn't see anything native. If someone else knows about this definitely correct me.

share|improve this answer
    
right, no save for web SVG support in CS6 –  maxedison Aug 28 '12 at 15:01
    
But your CS5 solution does indeed work for CS6. Thanks! –  maxedison Aug 28 '12 at 15:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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