Adobe Illustrator CS5 Type Library JS: Document

Illustrator CS5

Class

Document

 A document.

QuickLinks

activate, close, convertCoordinate, exportFile, exportPDFPreset, exportPerspectiveGridPreset, exportPrintPreset, exportVariables, fitArtboardToSelectedArt, getPerspectiveActivePlane, hidePerspectiveGrid, imageCapture, importCharacterStyles, importPDFPreset, importParagraphStyles, importPerspectiveGridPreset, importPrintPreset, importVariables, print, rasterize, rearrangeArtboards, save, saveAs, selectObjectsOnActiveArtboard, selectPerspectivePreset, setPerspectiveActivePlane, showPerspectiveGrid, windowCapture

Hierarchy

Object
Document

Properties

PropertyTypeAccessDescription
XMPStringstring r/wThe XMP packet string associated with the document.
activeDataSetDataSet r/wThe active data set.
activeLayerLayer r/wThe active layer.
activeViewView readonlyThe document's current view.
artboardsArtboards readonlyAll artboards in the document.
brushesBrushes readonlyThe brushes defined in this document.
characterStylesCharacterStyles readonlyThe list of character styles in this document.
compoundPathItemsCompoundPathItems readonlyThe compound path artwork in this collection.
cropBoxRect r/w
cropStyleCropOptions:
CropOptions.Standard
CropOptions.Japanese
r/w
dataSetsDataSets readonlyThe data sets defined in this document.
defaultFillColorColor r/wDefault fill color.
defaultFillOverprintbool r/wWill art beneath a filled object be overprinted by default?
defaultFilledbool r/wShould a new path be filled?
defaultStrokeCapStrokeCap:
StrokeCap.BUTTENDCAP
StrokeCap.ROUNDENDCAP
StrokeCap.PROJECTINGENDCAP
r/wDefault type of line capping.
defaultStrokeColorColor r/wDefault stroke color.
defaultStrokeDashOffsetnumber r/wThe default distance into the dash pattern at which the pattern should be started.
defaultStrokeDashes Array of number r/wDefault dash lengths (set to {} for a solid line)
defaultStrokeJoinStrokeJoin:
StrokeJoin.MITERENDJOIN
StrokeJoin.ROUNDENDJOIN
StrokeJoin.BEVELENDJOIN
r/wDefault type of joints.
defaultStrokeMiterLimitnumber r/wSpecifies whether a join is mitered (pointed) or beveled (squared-off) by default.
defaultStrokeOverprintbool r/wWill art beneath a stroked object be overprinted by default?
defaultStrokeWidthnumber r/wDefault width of stroke.
defaultStrokedbool r/wShould a new path be stroked?
documentColorSpaceDocumentColorSpace:
DocumentColorSpace.RGB
DocumentColorSpace.CMYK
readonlyThe color space used for the document.
fullNameFile readonlyThe file associated with the document.
geometricBoundsRect readonlyThe bounds of the illustration excluding stroke width.
gradientsGradients readonlyThe gradients available in this document.
graphItemsGraphItems readonlyThe graph art items in this document.
graphicStylesArtStyles readonlyThe graphic styles defined in this document.
groupItemsGroupItems readonlyThe group items in this document.
heightnumber readonly
inkList Array of Ink readonlyThe list of inks in this document.
kinsokuSet Array of string readonlyThe Kinsoku set.
layersLayers readonlyThe layers in this document.
legacyTextItemsLegacyTextItems readonlyThe text frame items in this story.
meshItemsMeshItems readonlyThe mesh art items in this document.
mojikumiSet Array of string readonlyThe Mojikumi set.
namestring readonlyThe document's name.
nonNativeItemsNonNativeItems readonlyThe non-native art items in this document.
outputResolutionnumber readonly
pageItemsPageItems readonlyAll the artwork in this document.
pageOriginPoint r/w
paragraphStylesParagraphStyles readonlyThe list of paragraph styles in this document.
parentObject readonlyThe object's container.
pathFile readonlyPath specification for the document.
pathItemsPathItems readonlyThe path artwork in this document.
patternsPatterns readonlyThe patterns available in this document.
placedItemsPlacedItems readonlyThe placed art items in this document.
pluginItemsPluginItems readonlyThe plugin art items in this document.
printTilesbool readonly
rasterEffectSettingsRasterEffectOptions r/wThe document raster effects settings.
rasterItemsRasterItems readonlyThe raster art items in this document.
rulerOriginPoint r/w
rulerUnitsRulerUnits:
RulerUnits.Unknown
RulerUnits.Inches
RulerUnits.Centimeters
RulerUnits.Points
RulerUnits.Picas
RulerUnits.Millimeters
RulerUnits.Qs
RulerUnits.Pixels
readonly
savedbool r/wHas the document been saved?
selectionany r/wThe selection within the document.
showPlacedImagesbool readonly
splitLongPathsbool readonly
spotsSpots readonlyThe custom spot colors available in this document.
stationerybool readonlyIs the file a stationery file?
storiesStories readonlyThe story items in this document.
swatchGroupsSwatchGroups readonlyThe Swatch Groups in this document.
swatchesSwatches readonlyThe swatches in this document.
symbolItemsSymbolItems readonlyThe symbol items in this document.
symbolsSymbols readonlyThe symbols defined in this document.
tagsTags readonlyThe tags in this document.
textFramesTextFrameItems readonlyThe text frame items in this document.
tileFullPagesbool readonly
typenamestring readonlyThe class name of the object.
useDefaultScreenbool readonly
variablesVariables readonlyThe variables defined in this document.
variablesLockedbool r/wThe locked variables.
viewsViews readonlyThe views in this document.
visibleBoundsRect readonlyThe visible bounds of the illustration including stroke width.
widthnumber readonly

Methods

Instances

void activate ()
Activate the first window associated with the document.

void close ([saving: SaveOptions])
Close the specified document(s)

ParameterTypeDescription
savingSaveOptions:
SaveOptions.SAVECHANGES
SaveOptions.DONOTSAVECHANGES
SaveOptions.PROMPTTOSAVECHANGES
Specifies whether changes should be saved before closing. (Optional)

Point convertCoordinate (coordinate: Point, source: CoordinateSystem, destination: CoordinateSystem)
Converts the coordinate system of a single point from one coordinate system to another.

ParameterTypeDescription
coordinatePointThe Coordinate to convert.
sourceCoordinateSystem:
CoordinateSystem.DOCUMENTCOORDINATESYSTEM
CoordinateSystem.ARTBOARDCOORDINATESYSTEM
The source coordinate system.
destinationCoordinateSystem:
CoordinateSystem.DOCUMENTCOORDINATESYSTEM
CoordinateSystem.ARTBOARDCOORDINATESYSTEM
The destination coordinate system.

void exportFile (exportFile: File, exportFormat: ExportType[, options: any])
Export the specified document(s)

ParameterTypeDescription
exportFileFileThe file to export the document to.
exportFormatExportType:
ExportType.JPEG
ExportType.PHOTOSHOP
ExportType.SVG
ExportType.PNG8
ExportType.PNG24
ExportType.GIF
ExportType.FLASH
ExportType.AUTOCAD
The file type to export the document as.
options any Options for the file type specified. (Optional)

void exportPDFPreset (file: File)
Save all PDF presets to a file.

ParameterTypeDescription
fileFileFile to export to.

void exportPerspectiveGridPreset (file: File)
Saves all perspective grid presets to a file.

ParameterTypeDescription
fileFileFile to export to.

void exportPrintPreset (file: File)
Export the current print setting to the preset file.

ParameterTypeDescription
fileFileFile to export to.

void exportVariables (file: File)
Save datasets into an XML library. The datasets contain variables and their associated dynamic data.

ParameterTypeDescription
fileFileFile spec to export to.

bool fitArtboardToSelectedArt ([index: int])
Change the artboard to selected art bounds.

ParameterTypeDescription
indexintThe index of the artboard to update. (Optional)

PerspectiveGridPlaneType getPerspectiveActivePlane ()
Gets the active plane of the active perspective grid of the document.

bool hidePerspectiveGrid ()
Hides the current active perspective grid for the document, if there is visible perspective grid.

void 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.

ParameterTypeDescription
imageFileFileThe file to which the captured image should be written.
clipBoundsRectThe rectangular region of the artwork for image capture. If the parameter is omitted, the entire artwork bound is captured. (Optional)
optionsImageCaptureOptionsDescribes the image capture options. (Optional)

void importCharacterStyles (fileSpec: File)
Load the character styles from the Illustrator file.

ParameterTypeDescription
fileSpecFileFile spec to import from.

void importPDFPreset (fileSpec: File[, replacingPreset: bool=false])
Load all PDF presets from a file.

ParameterTypeDescription
fileSpecFileFile to import from.
replacingPresetboolShould existing editable presets be replaced? (default: false) (Optional)

void importParagraphStyles (fileSpec: File)
Load the paragraph styles from the Illustrator file.

ParameterTypeDescription
fileSpecFileFile spec to import from.

void importPerspectiveGridPreset (fileSpec: File[, perspectivePreset: 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.

ParameterTypeDescription
fileSpecFileFile to import from.
perspectivePresetstringName of perspective grid preset. (default: ) (Optional)

void importPrintPreset (printPreset: string, fileSpec: File)
Apply the named print preset from the file to the current print setting.

ParameterTypeDescription
printPresetstringThe name of a print preset to import.
fileSpecFileFile to import from.

void importVariables (fileSpec: File)
Import a library containing datasets, variables and their associated dynamic data. Importing variables will overwrite existing variables and datasets.

ParameterTypeDescription
fileSpecFileFile spec to import from.

void print ([options: PrintOptions])
Print the document.

ParameterTypeDescription
optionsPrintOptionsPrint options. (Optional)

PageItem rasterize (sourceArt: any[, 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.

ParameterTypeDescription
sourceArt any The page item(s) to be rasterized.
clipBoundsRectThe rectangular region of the artwork for the rasterization. If the parameter is omitted, the bounds of the source art(s) is used instead. (Optional)
optionsRasterizeOptionsDescribes the rasterization options. (Optional)

bool rearrangeArtboards ([artboardLayout: DocumentArtboardLayout=DocumentArtboardLayout.GridByRow][, artboardRowsOrCols: int=1][, artboardSpacing: number=20.0][, artboardMoveArtwork: bool=true])
Rearrange Artboards in the document.

ParameterTypeDescription
artboardLayoutDocumentArtboardLayout:
DocumentArtboardLayout.GridByRow
DocumentArtboardLayout.GridByCol
DocumentArtboardLayout.Row
DocumentArtboardLayout.Column
DocumentArtboardLayout.RLGridByRow
DocumentArtboardLayout.RLGridByCol
DocumentArtboardLayout.RLRow
Layout of artboards for rearrangement. (default: DocumentArtboardLayout.GridByRow) (Optional)
artboardRowsOrColsintNumber 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) (Optional)
artboardSpacingnumberSpacing between artboards. (default: 20.0) (Optional)
artboardMoveArtworkboolWhether to move artwork with artboards. (default: true) (Optional)

void save ()
Save the document.

void saveAs (saveIn: File[, options: any])
Save the document with specific save options.

ParameterTypeDescription
saveInFileThe file to save the document in.
options any Options for the file type specified. (Optional)

bool selectObjectsOnActiveArtboard ()
Select art objects in active artboard.

bool selectPerspectivePreset (perspectivePreset: string)
Selects a predefined preset to define grid for the current document.

ParameterTypeDescription
perspectivePresetstringName of perspective grid preset.

bool setPerspectiveActivePlane (perspectiveGridPlane: PerspectiveGridPlaneType)
Sets the active perspective plane for the active grid of the document.

ParameterTypeDescription
perspectiveGridPlanePerspectiveGridPlaneType:
PerspectiveGridPlaneType.NOPLANE
PerspectiveGridPlaneType.LEFTPLANE
PerspectiveGridPlaneType.RIGHTPLANE
PerspectiveGridPlaneType.FLOORPLANE
Type of perspective grid plane.

bool showPerspectiveGrid ()
Shows the current active perspective grid for the document, if no active perspective grid then shows the default perspective grid for the document.

void windowCapture (imageFile: File, windowSize: Point)
Capture the current document window to the target TIFF image file.

ParameterTypeDescription
imageFileFileThe TIFF file to which the captured image should be written.
windowSizePointThe size to make the window before capture.

Element of

Application.activeDocument

Return

Document Application.open (file: File[, documentColorSpace: DocumentColorSpace][, options: any])

Document Documents.add ([documentColorSpace: DocumentColorSpace=DocumentColorSpace.CMYK][, width: number=612.0][, height: number=792.0][, numArtboards: int=1][, artboardLayout: DocumentArtboardLayout=DocumentArtboardLayout.GridByRow][, artboardSpacing: number=20.0][, artboardRowsOrCols: int=1])

Document Documents.addDocument (startupPreset: string, presetSettings: DocumentPreset)

Document Documents.getByName (name: string)

Jongware, 27-Jun-2010 v3.0.3dContents :: Index