29

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.

4 Answers 4

37

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.

3
  • Giving this the answer since it provides the most convenient way to achieve this (especially by assigning a keyboard shortcut). Thanks!
    – maxedison
    Commented Aug 29, 2012 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
    Commented Mar 3, 2014 at 12:29
  • Alternatively, choosing Fit to Selected Art works if you have other artboards, or art, laying around.
    – mhulse
    Commented Mar 8, 2016 at 18:28
4

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.

2
  • right, no save for web SVG support in CS6
    – maxedison
    Commented Aug 28, 2012 at 15:01
  • But your CS5 solution does indeed work for CS6. Thanks!
    – maxedison
    Commented Aug 28, 2012 at 15:07
0

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!!!

-1

I know how to handle this. After "Save for web and device" go to 4-Up tab. On the right side, click on the "Image Size" tab. Then tick on "Clip to Artboard" check box.

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.