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
    • Barcode
    • Barcode Formats
    • Clean Document
    • Clipping Mask Make and Release
    • Color Mode
    • Comment
    • Compound Path - Make and Release
    • Distribute
    • Duplicate
    • Expand
    • Fit To Bounds
    • Graphic Style
    • Group & Ungroup
    • Layer Methods
    • Outline
    • Pathfinder
    • Place
    • Rasterize
    • Reduce To Basic Appearance
    • Remove
    • Swatch Methods
    • Tags Methods
    • Template
    • Text
    • Transform Methods
    • zOrder
    • Skip and *
  • Colors

    • Color Libraries
  • User Interface

    • Darty User-Interface
    • Tools Tab
    • Tools Builder
      • Builder Table Anatomy
      • Builder Data Sources and Files
      • Builder Method Blocks
      • Builder Rows, Cells, and Navigation
    • Tools Methods
      • Tools Method Actions and Apply Modes
      • Tools Method Table Preview
      • Align Tool
      • Appearance Tool
      • Graphic Style Tool
      • Artboard Tool
      • Attributes Tool
      • Arrange Tool
      • Barcode Tool
      • Color Mode Tool
      • Clean Tool
      • Clipping Tool
      • Comment Tool
      • Compound Path Tool
      • Distribute Tool
      • Duplicate Tool
      • Expand Tool
      • Fit to Bounds Tool
      • Group Tool
      • Ungroup Tool
      • Layer Tool
      • Outline Tool
      • Pathfinder Tool
      • Place Tool
      • Rasterize Tool
      • Reduce Tool
      • Remove Tool
      • Swatches Tool
      • Tags Tool
      • Text Tool
      • Transform Tool
      • Z-Order Tool
    • 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
  • Site Blog

    • ⭐️Getting Started ⭐️
    • ⭐️Placing Images in Darty-Ai ⭐️
    • 🚀 New Features — Darty-Ai 1.7.8 (March 2026)
    • Creating a Basic Pie-Chart with Line-Art & Data
    • Customer Data and Darty-Ai
    • Darty-Ai Now Supports Google Sheets
    • External SVGs with Darty-Ai
    • Preview Your Documents
    • Self-Adjusting Logo Automation
    • State Management for Artwork Appearance
    • Text Replacements and Formatting
    • Using Private Google Sheets Shared with Business Emails
  • Site Pages

    • 🏠 Home
    • 💰 Pricing
    • Downloads
  • Release Notes
  • Downloads

Fit To Bounds

The fitToBounds method is used for fitting the bounds of artboards to artwork items and optionally applying padding around the artwork. The method changes the artboard rectangles; it does not move or scale the artwork. The fitted rectangle uses the artwork's visible bounds.

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.
Use the left, right, top and bottom properties if you want to set different padding for the different sides of the artboards. Each omitted side keeps its current artboard edge, so leave a side blank only when that edge should remain fixed. If neither padding nor any side padding is set, the current artboard rectangle remains unchanged.

See the Fit to Bounds Tool for the visual editor.

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 exact, case-sensitive artboard names to adjust. Names can be used by themselves or together with artboardNumbers; when both are present, the unique matches are combined. If no artboard names or numbers are provided, all artboards are considered.
Sample Values: Artboard 1, Artboard 2, Artboard 3
artboardNumbers 
A list of one-based artboard numbers to adjust. Numbers can be used by themselves or together with artboardNames; when both are present, the unique matches are combined. If no artboard names or numbers are provided, all artboards are considered.
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: 7/21/26, 9:02 AM
Contributors: Trevor, Vasily Hall
Prev
Expand
Next
Graphic Style