DocumentationDocumentation
Darty.ai
Get Started
Basics
Methods
Colors
UI
Workflows
Darty.ai
Get Started
Basics
Methods
Colors
UI
Workflows
  • Get Started

    • Installation and Login
    • Your First Darty Document
    • Installers - Instructions and Downloads
    • Licensing
  • Basics

    • Darty Basics
    • Darty Header
    • Darty Tags
  • Methods

    • Darty Methods
    • Align
    • Appearance - General
    • Appearance - Colors & Swatches
    • Appearance - Effect Properties
    • Artboard Methods
    • Arrange
    • Attributes
    • Clean Document
    • Clipping Mask Make and Release
    • Color Mode
    • Compound Path - Make and Release
    • Distribute
    • Duplicate
    • Expand
    • Fit To Bounds
    • Group & Ungroup
    • Layer Methods
    • Outline
    • Pathfinder
    • Place
    • Rasterize
    • Reduce To Basic Appearance
    • Remove
    • Swatch Methods
    • Tags Methods
    • Text
    • Transform Methods
    • zOrder
    • Skip and *
  • Colors

    • Color Libraries
  • User Interface

    • Darty User-Interface
    • Tags Tab
    • Data Tab
    • Export Tab
    • Settings Tab
    • Help Tab
    • Export Settings
    • Export Validation
    • Job Export Settings
    • Export Counter Variables
    • Export Progress
    • Export Presets
    • Recent Files
    • Color Dialog
  • Cloud Data

    • Darty-Ai Cloud Data Integrations
    • Darty-Ai with Google Sheets
  • Workflows

    • Darty Workflows
    • Darty Preview
    • Darty Export Workflows
    • Darty Data Workflows

Fit To Bounds

The fitToBounds method is used for fitting the bounds of artboards to artwork items and optionally applying a padding from the artworkItems.

By default artwork items currently on the artboards are used to define the artboard bounds.
To include artwork which is currently not in the artboards bounds, set the artboardItems property to false.
Set a tagSearch to limit the artwork to be considered.
Set a layerName or layerNumber to limit the artwork to be considered to a given layer.
Set a list of artboardNames or artboardNumbers to specify the artboards whose bounds should be adjusted.
If no artboards are specified, the bounds of all of the artboards will be adjusted.
To set equal padding for all sides of the artboards use the padding property.
If no padding is set, the artboard will adjust to the visual bounds of the artwork.
Use the left, right, top and bottom properties if you want to set different padding for the different sides of the artboards.

Sample Spreadsheet and Screenshots

*
fitToBounds
artboardNumbersfromArtboardItemstagSearchpadding: 5layerNumberpaddingLeftpaddingRightpaddingToppaddingBottom
5
1, 25
1, 2FALSE5
circle5
circle:210203040

Compare each row in the spreadsheet below with its associated screenshot below.

Original Artwork

Original Artboards

Row - 1

Row - 1
Only the padding property has been set, ALL the artboards will resize to pad 5pt from all artwork currently on them.

Offset Row - 2

Row - 2
padding: 5 artboardNumbers: 1, 2 Only the bounds of artboards 1 and 2 will be adjusted

Row - 3

Row - 3
fromArtboardItems: false artboardNumbers: 1, 2 padding: 5 The bounds of artboards 1 and 2 will be adjusted to pad all the artwork in the document by 5pt.

Row - 4

Row - 4
padding: 5 tagSearch: circle The bounds of all the artboards will be adjusted to artwork tagged circle which is in their bounds.

Row - 5

Row - 5
tagSearch: circle layerNumber: 2 paddingLeft: 10 paddingRight: 20 paddingTop: 30 paddingBottom: 40 The bounds of all the artboards will be adjusted to artwork tagged circle in layer 2 which is in their bounds.

Method Properties and Screenshot

See Basic Stroke and Fill Properties

ModeDescription
* 
Set to false if you want the method to be skipped in a particular row.
Valid Values: true or false
artboardItems /fromArtboardItems  
Whether artboards bounds should be adjusted only to items currently in their bounds
Valid Values: true [Default] or false
artboardNames 
A list of artboard names of the artboards to be adjusted. Either use artboardNames or artboardNumbers and not both. If no artboard names or numbers are provided, the bounds of all artboards will be adjusted
Sample Values: Artboard 1, Artboard 2, Artboard 3
artboardNumbers 
A list of artboard numbers of the artboards to be adjusted. Either use artboardNames or artboardNumbers and not both. If no artboard names or numbers are provided, the bounds of all artboards will be adjusted
Sample Values: 1, 2, 3
layerName 
Specify a layer name if you want to limit the artwork that the artboard bounds should be adjusted to to a specific layer
Sample Values: Layer 1, Layer 2, Layer 3
layerNumber 
Specify a layer number if you want to limit the artwork that the artboard bounds should be adjusted to to a specific layer
Sample Values: 1, 2, 3
padding 
The padding from artwork, (can be used when padding on all sides is equal)
Sample Values: 36, 36pt, .5", 12.6mm
paddingBottom /bottom 
Bottom padding from artwork
Sample Values: 36, 36pt, .5", 12.6mm
paddingLeft /left 
Left padding from artwork
Sample Values: 36, 36pt, .5", 12.6mm
paddingRight /right 
Right padding from artwork
Sample Values: 36, 36pt, .5", 12.6mm
paddingTop /top 
Top padding from artwork
Sample Values: 36, 36pt, .5", 12.6mm
skip 
Set to true is you want the method to be skipped in a particular row.
See * and Skip for details.
Valid Values: true or false
tagSearch 
Specify a tagSearch if you want to limit the artwork that the artboard bounds should be adjusted to specific artwork items
Sample Values: cats, cats | dogs, animals & !dogs
Last Updated: 3/18/26, 2:06 AM
Contributors: Trevor
Prev
Expand
Next
Group & Ungroup