Document

A document.

Methods:

activate, close, convertCoordinate, convertToLargeCanvas, exportFile, exportForScreens, exportPDFPreset, exportPerspectiveGridPreset, exportPrintPreset, exportSelectionAsAi, exportSelectionAsPNG, exportVariables, fitArtboardToSelectedArt, getPageItemFromUuid, getPerspectiveActivePlane, hidePerspectiveGrid, imageCapture, importCharacterStyles, importFile, importPDFPreset, importParagraphStyles, importPerspectiveGridPreset, importPrintPreset, importVariables, print, processGesture, rasterize, rearrangeArtboards, save, saveAs, saveToCloud, selectObjectsOnActiveArtboard, selectPerspectivePreset, setPerspectiveActivePlane, showPerspectiveGrid, windowCapture, writeAsLibrary

Objects:

ArtStyles, Artboards, Assets, Boolean, Brushes, CharacterStyles, Color, CompoundPathItems, CropOptions, DataSet, DataSets, DocumentColorSpace, EmbeddedItems, File, Gradients, GraphItems, GridRepeatItems, GroupItems, Ink, Layer, Layers, LegacyTextItems, MeshItems, NonNativeItems, Number, PageItems, ParagraphStyles, PathItems, Patterns, PlacedItems, PluginItems, Point, RadialRepeatItems, RasterEffectOptions, RasterItems, RulerUnits, Spots, Stories, String, StrokeCap, StrokeJoin, SwatchGroups, Swatches, SymbolItems, Symbols, SymmetryRepeatItems, Tags, TextFrameItems, Variables, View, Views

Property Listing

Property

Type

Access

Description

XMPString

String

read/write

The XMP packet string associated with the document.

activeDataSet

DataSet

read/write

The active data set.

activeLayer

Layer

read/write

The active layer.

activeView

View

readonly

The document's current view.

artboards

Artboards Artboard

readonly

All artboards in the document.

assets

Assets Asset

readonly

All assets in the document.

brushes

Brushes

readonly

The brushes defined in this document.

characterStyles

CharacterStyles CharacterStyle

readonly

The list of character styles in this document.

cloudPath

String

readonly

Path specification for the cloud document.

colorProfileName

String

readonly

The name of the color profile of the document.

compoundPathItems

CompoundPathItems CompoundPathItem

readonly

The compound path artwork in this collection.

cropBox

Rect

read/write

 

cropStyle

CropOptions

CropOptions.Japanese

CropOptions.Standard

read/write

 

dataSets

DataSets DataSet

readonly

The data sets defined in this document.

defaultFillColor

Color

read/write

Default fill color.

defaultFillOverprint

Boolean

read/write

Will art beneath a filled object be overprinted by default?

defaultFilled

Boolean

read/write

Should a new path be filled?

defaultStrokeCap

StrokeCap

StrokeCap.BUTTENDCAP

StrokeCap.PROJECTINGENDCAP

StrokeCap.ROUNDENDCAP

read/write

Default type of line capping.

defaultStrokeColor

Color

read/write

Default stroke color.

defaultStrokeDashOffset

Number

read/write

The default distance into the dash pattern at which the pattern should be started.

defaultStrokeDashes

Array of Number

read/write

Default dash lengths (set to {} for a solid line)

defaultStrokeJoin

StrokeJoin

StrokeJoin.BEVELENDJOIN

StrokeJoin.MITERENDJOIN

StrokeJoin.ROUNDENDJOIN

read/write

Default type of joints.

defaultStrokeMiterLimit

Number

read/write

Specifies whether a join is mitered (pointed) or beveled (squared-off) by default.

defaultStrokeOverprint

Boolean

read/write

Will art beneath a stroked object be overprinted by default?

defaultStrokeWidth

Number

read/write

Default width of stroke.

defaultStroked

Boolean

read/write

Should a new path be stroked?

documentColorSpace

DocumentColorSpace

DocumentColorSpace.CMYK

DocumentColorSpace.RGB

readonly

The color space used for the document.

embeddedItems

EmbeddedItems

readonly

The embedded art items in this layer.

fullName

File

readonly

The file associated with the document.

geometricBounds

Rect

readonly

The bounds of the illustration excluding stroke width.

gradients

Gradients Gradient

readonly

The gradients available in this document.

graphItems

GraphItems GraphItem

readonly

The graph art items in this document.

graphicStyles

ArtStyles ArtStyle

readonly

The graphic styles defined in this document.

gridRepeatItems

GridRepeatItems GridRepeatItem

readonly

The grid repeat items in this document.

groupItems

GroupItems GroupItem

readonly

The group items in this document.

height

Number

readonly

 

inkList

Array of Ink

readonly

The list of inks in this document.

isCloudDocument

Boolean

readonly

Is the document saved on cloud.

kinsokuSet

Array of String

readonly

The Kinsoku set.

layers

Layers Layer

readonly

The layers in this document.

legacyTextItems

LegacyTextItems LegacyTextItem

readonly

The text frame items in this story.

meshItems

MeshItems MeshItem

readonly

The mesh art items in this document.

mojikumiSet

Array of String

readonly

The Mojikumi set.

name

String

readonly

The document's name.

nonNativeItems

NonNativeItems NonNativeItem

readonly

The non-native art items in this document.

outputResolution

Number

readonly

 

pageItems

PageItems PageItem

readonly

All the artwork in this document.

pageOrigin

Point

read/write

 

paragraphStyles

ParagraphStyles ParagraphStyle

readonly

The list of paragraph styles in this document.

parent

 

readonly

The object's container.

path

File

readonly

Path specification for the document.

pathItems

PathItems PathItem

readonly

The path artwork in this document.

patterns

Patterns Pattern

readonly

The patterns available in this document.

placedItems

PlacedItems PlacedItem

readonly

The placed art items in this document.

pluginItems

PluginItems PluginItem

readonly

The plugin art items in this document.

printTiles

Boolean

readonly

 

radialRepeatItems

RadialRepeatItems RadialRepeatItem

readonly

The radial repeat items in this document.

rasterEffectSettings

RasterEffectOptions

read/write

The document raster effects settings.

rasterItems

RasterItems RasterItem

readonly

The raster art items in this document.

rulerOrigin

Point

read/write

 

rulerUnits

RulerUnits

RulerUnits.Centimeters

RulerUnits.Feet

RulerUnits.FeetInches

RulerUnits.Inches

RulerUnits.Meters

RulerUnits.Millimeters

RulerUnits.Picas

RulerUnits.Pixels

RulerUnits.Points

RulerUnits.Qs

RulerUnits.Unknown

RulerUnits.Yards

readonly

 

saved

Boolean

read/write

Has the document been saved?

scaleFactor

Number

readonly

The scale factor of the document.

selection

Varies

read/write

The selection within the document.

showPlacedImages

Boolean

readonly

 

splitLongPaths

Boolean

readonly

 

spots

Spots Spot

readonly

The custom spot colors available in this document.

stationery

Boolean

readonly

Is the file a stationery file?

stories

Stories Story

readonly

The story items in this document.

swatchGroups

SwatchGroups SwatchGroup

readonly

The Swatch Groups in this document.

swatches

Swatches

readonly

The swatches in this document.

symbolItems

SymbolItems SymbolItem

readonly

The symbol items in this document.

symbols

Symbols Symbol

readonly

The symbols defined in this document.

symmetryRepeatItems

SymmetryRepeatItems SymmetryRepeatItem

readonly

The symmetry repeat items in this document.

tags

Tags Tag

readonly

The tags in this document.

textFrames

TextFrameItems TextFrameItem

readonly

The text frame items in this document.

tileFullPages

Boolean

readonly

 

typename

String

readonly

The class name of the object.

useDefaultScreen

Boolean

readonly

 

variables

Variables Variable

readonly

The variables defined in this document.

variablesLocked

Boolean

read/write

The locked variables.

views

Views View

readonly

The views in this document.

visibleBounds

Rect

readonly

The visible bounds of the illustration including stroke width.

width

Number

readonly

 

Method Listing

undefined activate ()

Activate the first window associated with the document.

undefined close ([saving:SaveOptions])

Close the specified document(s)

Parameter

Type

Description

saving

SaveOptions

SaveOptions.DONOTSAVECHANGES

SaveOptions.PROMPTTOSAVECHANGES

SaveOptions.SAVECHANGES

Specifies whether changes should be saved before closing.

Point convertCoordinate (coordinate:Point, source:CoordinateSystem, destination:CoordinateSystem)

Converts the coordinate system of a single point from one coordinate system to another.

Parameter

Type

Description

coordinate

Point

The Coordinate to convert.

source

CoordinateSystem

CoordinateSystem.ARTBOARDCOORDINATESYSTEM

CoordinateSystem.DOCUMENTCOORDINATESYSTEM

The source coordinate system.

destination

CoordinateSystem

CoordinateSystem.ARTBOARDCOORDINATESYSTEM

CoordinateSystem.DOCUMENTCOORDINATESYSTEM

The destination coordinate system.

undefined convertToLargeCanvas ()

Convert the document to Large Canvas Document.

undefined exportFile (exportFile:File, exportFormat:ExportType, [options:Varies])

Export the specified document(s)

Parameter

Type

Description

exportFile

File

The file to export the document to.

exportFormat

ExportType

ExportType.AUTOCAD

ExportType.GIF

ExportType.JPEG

ExportType.PHOTOSHOP

ExportType.PNG24

ExportType.PNG8

ExportType.SVG

ExportType.TIFF

ExportType.WOSVG

The file type to export the document as.

options

Varies

Options for the file type specified.

undefined exportForScreens (exportFolder:File, exportFormat:ExportForScreensType, [options:Varies], [itemToExport:ExportForScreensItemToExport], [fileNamePrefix:String])

Export the specified document/asset(s)/artboard(s)

Parameter

Type

Description

exportFolder

File

The folder where the exported documents/assets/artboards are saved.

exportFormat

ExportForScreensType

ExportForScreensType.SE_JPEG100

ExportForScreensType.SE_JPEG20

ExportForScreensType.SE_JPEG50

ExportForScreensType.SE_JPEG80

ExportForScreensType.SE_PDF

ExportForScreensType.SE_PNG24

ExportForScreensType.SE_PNG8

ExportForScreensType.SE_SVG

The file type in which the document is exported.

options

Varies

Options for the file type specified.

itemToExport

ExportForScreensItemToExport

What to export.

fileNamePrefix

String

String prepended to each file name.

undefined exportPDFPreset (file:File)

Save all PDF presets to a file.

Parameter

Type

Description

file

File

File to export to.

undefined exportPerspectiveGridPreset (file:File)

Saves all perspective grid presets to a file.

Parameter

Type

Description

file

File

File to export to.

undefined exportPrintPreset (file:File)

Export the current print setting to the preset file.

Parameter

Type

Description

file

File

File to export to.

undefined exportSelectionAsAi (exportFile:File)

Export the selection as Ai file.

Parameter

Type

Description

exportFile

File

The file to export the selection to.

undefined exportSelectionAsPNG (exportFile:File, [options:Varies])

Export the selection as PNG file.

Parameter

Type

Description

exportFile

File

The file to export the selection to.

options

Varies

Options for the PNG24 export.

undefined exportVariables (file:File)

Save datasets into an XML library. The datasets contain variables and their associated dynamic data.

Parameter

Type

Description

file

File

File spec to export to.

Boolean fitArtboardToSelectedArt ([index:Int32])

Change the artboard to selected art bounds.

Parameter

Type

Description

index

Int32

The index of the artboard to update.

PageItem getPageItemFromUuid (uuid:String)

Retrieves the pageitem using Uuid.

Parameter

Type

Description

uuid

String

Uuid of pageitem.

PerspectiveGridPlaneType getPerspectiveActivePlane ()

Gets the active plane of the active perspective grid of the document.

Boolean hidePerspectiveGrid ()

Hides the current active perspective grid for the document, if there is visible perspective grid.

undefined imageCapture (imageFile:File, [clipBounds:Rect], [options:ImageCaptureOptions])

Capture the artwork content inside the clip bound as raster image, and write out the captured image data into the target image file.

Parameter

Type

Description

imageFile

File

The file to which the captured image should be written.

clipBounds

Rect

The rectangular region of the artwork for image capture. If the parameter is omitted, the entire artwork bound is captured.

options

ImageCaptureOptions

Describes the image capture options.

undefined importCharacterStyles (fileSpec:File)

Load the character styles from the Illustrator file.

Parameter

Type

Description

fileSpec

File

File spec to import from.

undefined importFile (importFile:File, isLinked:Boolean, [libraryName:String], [itemName:String], [elementRef:String], [modifiedTime:Number], [creationTime:Number], [adobeStockId:String], [adobeStockLicense:String], [shouldLoadToPlaceGun:Boolean])

Import the file into current Ai document.

Parameter

Type

Description

importFile

File

The file to import in the current document.

isLinked

Boolean

Is AssetLiveLinked.

libraryName

String

For Internal Use.

itemName

String

For Internal Use.

elementRef

String

For Internal Use.

modifiedTime

Number

For Internal Use.

creationTime

Number

For Internal Use.

adobeStockId

String

For Internal Use.

adobeStockLicense

String

For Internal Use.

shouldLoadToPlaceGun

Boolean

Whether or not to load the imported file to placegun.

undefined importPDFPreset (fileSpec:File, [replacingPreset:Boolean=Boolean])

Load all PDF presets from a file.

Parameter

Type

Description

fileSpec

File

File to import from.

replacingPreset

Boolean

Should existing editable presets be replaced?

(default: false)

undefined importParagraphStyles (fileSpec:File)

Load the paragraph styles from the Illustrator file.

Parameter

Type

Description

fileSpec

File

File spec to import from.

undefined importPerspectiveGridPreset (fileSpec:File, [perspectivePreset:String=String])

Loads mentioned perspective grid preset, if preset name is specified, else loads all(if no preset name is specified) presets, from the specified file.

Parameter

Type

Description

fileSpec

File

File to import from.

perspectivePreset

String

Name of perspective grid preset.

(default: )

undefined importPrintPreset (printPreset:String, fileSpec:File)

Apply the named print preset from the file to the current print setting.

Parameter

Type

Description

printPreset

String

The name of a print preset to import.

fileSpec

File

File to import from.

undefined importVariables (fileSpec:File)

Import a library containing datasets, variables and their associated dynamic data. Importing variables will overwrite existing variables and datasets.

Parameter

Type

Description

fileSpec

File

File spec to import from.

undefined print ([options:PrintOptions])

Print the document.

Parameter

Type

Description

options

PrintOptions

Print options.

undefined processGesture (gesturePointsFile:String)

Process a gesture based on input points.

Parameter

Type

Description

gesturePointsFile

String

File Path containing points constituting the gesture.

PageItem rasterize (sourceArt:Varies, [clipBounds:Rect], [options:RasterizeOptions])

Rasterize the source art(s) within the specified clip bounds. The source art(s) are disposed as a result of the rasterization.

Parameter

Type

Description

sourceArt

Varies

The page item(s) to be rasterized.

clipBounds

Rect

The rectangular region of the artwork for the rasterization. If the parameter is omitted, the bounds of the source art(s) is used instead.

options

RasterizeOptions

Describes the rasterization options.

Boolean rearrangeArtboards ([artboardLayout:DocumentArtboardLayout=DocumentArtboardLayout], [artboardRowsOrCols:Int32=Int32], [artboardSpacing:Number=Number], [artboardMoveArtwork:Boolean=Boolean])

Rearrange Artboards in the document.

Parameter

Type

Description

artboardLayout

DocumentArtboardLayout

DocumentArtboardLayout.Column

DocumentArtboardLayout.GridByCol

DocumentArtboardLayout.GridByRow

DocumentArtboardLayout.RLGridByCol

DocumentArtboardLayout.RLGridByRow

DocumentArtboardLayout.RLRow

DocumentArtboardLayout.Row

Layout of artboards for rearrangement.

(default: DocumentArtboardLayout.GridByRow)

artboardRowsOrCols

Int32

Number of rows (for rows layout) OR column(for column layouts)of artboards.Range is 1 to (docNumArtboards - 1) or 1 for single row or column layouts.

(default: 1)

artboardSpacing

Number

Spacing between artboards.

(default: 20.0)

artboardMoveArtwork

Boolean

Whether to move artwork with artboards.

(default: true)

undefined save ()

Save the document.

undefined saveAs (saveIn:File, [options:Varies])

Save the document with specific save options.

Parameter

Type

Description

saveIn

File

The file to save the document in.

options

Varies

Options for the file type specified.

undefined saveToCloud (cloudPath:String)

Save the document to cloud at the specified path.

Parameter

Type

Description

cloudPath

String

Path of the document to be saved on cloud.

Boolean selectObjectsOnActiveArtboard ()

Select art objects in active artboard.

Boolean selectPerspectivePreset (perspectivePreset:String)

Selects a predefined preset to define grid for the current document.

Parameter

Type

Description

perspectivePreset

String

Name of perspective grid preset.

Boolean setPerspectiveActivePlane (perspectiveGridPlane:PerspectiveGridPlaneType)

Sets the active perspective plane for the active grid of the document.

Parameter

Type

Description

perspectiveGridPlane

PerspectiveGridPlaneType

PerspectiveGridPlaneType.FLOORPLANE

PerspectiveGridPlaneType.LEFTPLANE

PerspectiveGridPlaneType.NOPLANE

PerspectiveGridPlaneType.RIGHTPLANE

Type of perspective grid plane.

Boolean showPerspectiveGrid ()

Shows the current active perspective grid for the document, if no active perspective grid then shows the default perspective grid for the document.

undefined windowCapture (imageFile:File, windowSize:Point)

Capture the current document window to the target TIFF image file.

Parameter

Type

Description

imageFile

File

The TIFF file to which the captured image should be written.

windowSize

Point

The size to make the window before capture.

undefined writeAsLibrary (file:File, libraryType:LibraryType)

Write the document to a file as a library of specified type.

Parameter

Type

Description

file

File

The file to write the library in.

libraryType

LibraryType

LibraryType.BRUSHES

LibraryType.GRAPHICSTYLES

LibraryType.ILLUSTRATORARTWORK

LibraryType.SWATCHES

LibraryType.SYMBOLS

Type of library to write as.

Object of

Application.activeDocument

Return

Documents.add()

Documents.addDocumentWithDialogOption()

Documents.addDocument()

Application.openCloudLibraryAssetForEditing()

Documents.getByName()

Application.openCloudDocument()

Application.open()