1

Is there a way to change the size of an Artboard using something like "Fit to Artwork Bounds", but that would also take into account the 3D rendering and dropped shadows? Thanks.

  • 1
    Group the objects and click it with artboard tool. – Naveed Abbas Jul 12 at 4:56
  • @ToughGuy make that an answer, see How to Answer – Luciano Jul 12 at 11:42
1

Group the objects, move the objects outside of the current artboard and click your the group with the "Artboard Tool". It will create a new artboard which fits the size. You can now delete the old artboard.

There is a very useful script which can resize the current artboard with a desired margin. (It asks the margin on run-time (e.g. 2px margin on all sides).

You can change the line var margins = 2; to your desired margin.

1) Save the text below in a text file and save it with any name with .jsx extension. For example. (resize_artboard.jsx)

2) In Illustrator > File > Scripts > Other Scripts and Browse the file.

(You can keep the file in the illustrator scripts directory for future use.)

#target Illustrator

//  script.name = Shrink to 2Px;
//  script.description = resizes active artboard to fit the the Art (+ 2px);
//  script.required = one document with at least one piece of art;


if (app.documents.length > 0)
{
//alert("more than 0");
var idoc = app.activeDocument;
var pageItemsCount = idoc.pageItems.length;
if (pageItemsCount>=1)
{ 

var margins = 2;

var activeABindex = idoc.artboards.getActiveArtboardIndex();
var newAB = idoc.artboards[activeABindex];

var iartBounds = idoc.visibleBounds;

var ableft = iartBounds[0]-margins;
var abtop = iartBounds[1]+margins;
var abright = iartBounds[2]+margins;
var abbottom = iartBounds[3]-margins;

newAB.artboardRect = [ableft, abtop, abright, abbottom];

var myZoom = idoc.activeView.zoom;
idoc.activeView.zoom = myZoom+.01;
idoc.activeView.zoom = myZoom;


}
else
{
alert("there is no art in the active document");
}
}
else 
{
alert ("there are no open documents");
}

Please keep in mind that if there are multiple artboards with objects in them, it doesn't automatically fix all artboards to their artworks.

To use it with multiple artboards, you can do the following procedure.

1) Select and Lock the objects you want to fit in your artboard with (Command + 2)

2) Command + A to select all other artwork.

3) Command + 3 to temporarily hide all other art

4) Select the artboard you want to fit on your artwork.

Repeat as necessary.

5) Run the script with as mentioned above

6) Command + Alt + 3 to Unhide all artwork.

Repeat as necessary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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