Graphic

An imported graphic in any graphic file format (including vector, metafile, and bitmap formats).

Methods:

detach, duplicate, exportFile, extractLabel, fit, flipItem, getElements, insertLabel, move, override, place, remove, removeOverride, resize, rotate, shear, toSource, toSpecifier, transformAgain, transformAgainIndividually, transformSequenceAgain, transformSequenceAgainIndividually

Objects:

Boolean, DisplaySettingOptions, Graphic, Guide, Link, Movie, Number, Object, PageItem, Sound, String,

Hierarchy:

Class: Graphic

Subclasses: Image | EPS | PDF | WMF | PICT

Property Listing

Property

Type

Access

Description

absoluteHorizontalScale

Number

read/write

The horizontal scale of the Graphic relative to its containing object.

absoluteRotationAngle

Number

read/write

The rotation angle of the Graphic relative to its containing object. (Range: -360 to 360)

absoluteShearAngle

Number

read/write

The skewing angle of the Graphic relative to its containing object. (Range: -360 to 360)

absoluteVerticalScale

Number

read/write

The vertical scale of the Graphic relative to its containing object.

geometricBounds

Array of Number

Array of String

read/write

The bounds of the Graphic excluding the stroke width, in the format [y1, x1, y2, x2], which give the coordinates of the top-left and bottom-right corners of the bounding box.

horizontalScale

Number

read/write

The horizontal scaling applied to the Graphic.

id

Number

readonly

The unique ID of the Graphic.

imageTypeName

String

readonly

The type of the image.

index

Number

readonly

The index of the Graphic within its containing object.

itemLink

Link

readonly

The source file of the link.

label

String

read/write

A property that can be set to any string.

localDisplaySetting

DisplaySettingOptions

DisplaySettingOptions.DEFAULT_VALUE

DisplaySettingOptions.HIGH_QUALITY

DisplaySettingOptions.OPTIMIZED

DisplaySettingOptions.TYPICAL

read/write

Display performance options for the Graphic.

overridden

Boolean

readonly

If true, the object originated on a master spread and was overridden. If false, the object either originated on a master spread and was not overridden, or the object did not originate on a master page.

overriddenMasterPageItem

Graphic

Guide

Movie

PageItem

Sound

readonly

An object that originated on a master page and has been overridden. Can return: PageItem, Guide, Graphic, Movie or Sound.

parent

GraphicLine

Group

Oval

Polygon

Rectangle

State

Button

PageItem

readonly

The parent of the Graphic (a PageItem, Oval, Rectangle, Polygon, GraphicLine, State, Group or Button).

properties

Object

read/write

A property that allows setting of several properties at the same time.

rotationAngle

Number

read/write

The rotatation angle of the Graphic. (Range: -360 to 360)

shearAngle

Number

read/write

The skewing angle applied to the Graphic. (Range: -360 to 360)

verticalScale

Number

read/write

The vertical scaling applied to the Graphic.

visibleBounds

Array of Number

Array of String

read/write

The bounds of the Graphic including the stroke width, in the format [y1, x1, y2, x2], which give the coordinates of the top-left and bottom-right corners of the bounding box.

Method Listing

undefined detach ()

Detaches an overridden master page item from the master page.

PageItem duplicate (by:Array of Number String)

Duplicates the Graphic.

Parameter

Type

Description

by

Array of Number

Array of String

The amount (in points) to offset the new Graphic, in the format [x, y]. (Optional)

undefined exportFile (format:Varies ExportFormat String, to:File, [showingOptions:Boolean=Boolean], using:PDFExportPreset)

Exports the object(s) to a file.

Parameter

Type

Description

format

ExportFormat

ExportFormat.EPS_TYPE

ExportFormat.INCOPY

ExportFormat.INCOPY_CS2_STORY

ExportFormat.INDESIGN_INTERCHANGE

ExportFormat.INDESIGN_SNIPPET

ExportFormat.JPG

ExportFormat.PDF_TYPE

ExportFormat.RTF

ExportFormat.SVG

ExportFormat.SVG_COMPRESSED

ExportFormat.TAGGED_TEXT

ExportFormat.TEXT_TYPE

ExportFormat.XML

String

The export format. Can accept: ExportFormat enumerator or String.

to

File

The path of the export file.

showingOptions

Boolean

If true, prompts the user to select export options. (Optional)

(default: false)

using

PDFExportPreset

The export style to use. (Optional)

String extractLabel (key:String)

Gets the label value associated with the specified key.

Parameter

Type

Description

key

String

The key.

undefined fit (given:FitOptions)

Applies the specified fit option to content in a frame.

Parameter

Type

Description

given

FitOptions

FitOptions.CENTER_CONTENT

FitOptions.CONTENT_TO_FRAME

FitOptions.FILL_PROPORTIONALLY

FitOptions.FRAME_TO_CONTENT

FitOptions.PROPORTIONALLY

The fit option to use.

undefined flipItem (given:FlipItemOptions, around:Array of Varies 2 Units AnchorPoint, [transformingContent:Boolean=Boolean])

Flip item about given axis

Parameter

Type

Description

given

FlipItemOptions

FlipItemOptions.BOTH

FlipItemOptions.HORIZONTAL

FlipItemOptions.VERTICAL

flip item options

around

Array of 2 Units

AnchorPoint

AnchorPoint.BOTTOM_CENTER_ANCHOR

AnchorPoint.BOTTOM_LEFT_ANCHOR

AnchorPoint.BOTTOM_RIGHT_ANCHOR

AnchorPoint.CENTER_ANCHOR

AnchorPoint.LEFT_CENTER_ANCHOR

AnchorPoint.RIGHT_CENTER_ANCHOR

AnchorPoint.TOP_CENTER_ANCHOR

AnchorPoint.TOP_LEFT_ANCHOR

AnchorPoint.TOP_RIGHT_ANCHOR

The point to flip around. Can accept: Array of 2 Units or AnchorPoint enumerator. (Optional)

transformingContent

Boolean

If true then both the object and items within it are flipped (Optional)

(default: true)

Object getElements ()

Resolves the object specifier, creating an array of object references.

undefined insertLabel (key:String, value:String)

Sets the label to the value associated with the specified key.

Parameter

Type

Description

key

String

The key.

value

String

The value.

undefined move (to:Array of Varies 2 Units Page Spread Layer, by:Array of Number String, [transformingContent:Boolean=Boolean])

Move Page Item to a new location. One of the 'To' or 'By' parameters is required.

Parameter

Type

Description

to

Array of 2 Units

Page

Spread

Layer

The new location of the object. Can accept: Array of 2 Units, Spread, Page or Layer. (Optional)

by

Array of Number

Array of String

Amount by which to move the object relative to its current position (Optional)

transformingContent

Boolean

If true then both the object and items within it are moved (Optional)

(default: true)

Varies override (destinationPage:Page)

Overrides a master page item and places the item on the document page as a new object.

Parameter

Type

Description

destinationPage

Page

The document page that contains the master page item to override.

Varies place (fileName:File, [showingOptions:Boolean=Boolean], withProperties:Object)

Place a file

Parameter

Type

Description

fileName

File

The file to place

showingOptions

Boolean

Whether to display the import options dialog (Optional)

(default: false)

withProperties

Object

Initial values for properties of the placed object(s) (Optional)

undefined remove ()

Deletes the Graphic.

undefined removeOverride ()

Removes the override from a previously overridden master page item.

undefined resize (horizontalScale:Number, verticalScale:Number, around:Array of Varies 2 Units AnchorPoint, [consideringCurrentScale:Boolean=Boolean], [transformingContent:Boolean=Boolean], [consideringParentsScale:Boolean=Boolean])

Resize the page item. You must specify either horizontal scale or vertical scale or both.

Parameter

Type

Description

horizontalScale

Number

The percentage of horizontal scale (Optional)

verticalScale

Number

The percentage of vertical scale (Optional)

around

Array of 2 Units

AnchorPoint

AnchorPoint.BOTTOM_CENTER_ANCHOR

AnchorPoint.BOTTOM_LEFT_ANCHOR

AnchorPoint.BOTTOM_RIGHT_ANCHOR

AnchorPoint.CENTER_ANCHOR

AnchorPoint.LEFT_CENTER_ANCHOR

AnchorPoint.RIGHT_CENTER_ANCHOR

AnchorPoint.TOP_CENTER_ANCHOR

AnchorPoint.TOP_LEFT_ANCHOR

AnchorPoint.TOP_RIGHT_ANCHOR

The point to scale around. Can accept: Array of 2 Units or AnchorPoint enumerator. (Optional)

consideringCurrentScale

Boolean

If true then the object's current scale and new scale will be combined. If false then the new value is absolute. The default value is false. (Optional)

(default: false)

transformingContent

Boolean

If true then both the object and items within it are scaled (Optional)

(default: true)

consideringParentsScale

Boolean

If true then the object is scaled relative to its parent page item. If false it is scaled relative to the spread. (Optional)

(default: false)

undefined rotate (by:Number, around:Array of Varies 2 Units AnchorPoint, [consideringCurrentRotation:Boolean=Boolean], [transformingContent:Boolean=Boolean], [consideringParentsRotation:Boolean=Boolean])

Rotate the page item

Parameter

Type

Description

by

Number

Angle by which to rotate the page item

around

Array of 2 Units

AnchorPoint

AnchorPoint.BOTTOM_CENTER_ANCHOR

AnchorPoint.BOTTOM_LEFT_ANCHOR

AnchorPoint.BOTTOM_RIGHT_ANCHOR

AnchorPoint.CENTER_ANCHOR

AnchorPoint.LEFT_CENTER_ANCHOR

AnchorPoint.RIGHT_CENTER_ANCHOR

AnchorPoint.TOP_CENTER_ANCHOR

AnchorPoint.TOP_LEFT_ANCHOR

AnchorPoint.TOP_RIGHT_ANCHOR

The point to rotate around. Can accept: Array of 2 Units or AnchorPoint enumerator. (Optional)

consideringCurrentRotation

Boolean

If true then the object's current rotation and new rotation will be combined. If false then the new value is absolute. The default value is false. (Optional)

(default: false)

transformingContent

Boolean

If true then both the object and items within it are rotated (Optional)

(default: true)

consideringParentsRotation

Boolean

If true then the object is rotated relative to its parent page item. If false it is rotated relative to the spread. Cannot rotate with considering current rotation and considering parents rotation both set at the same time. (Optional)

(default: false)

undefined shear (by:Number, around:Array of Varies 2 Units AnchorPoint, [shearAxisAngle:Number=Number], [consideringCurrentShear:Boolean=Boolean], [transformingContent:Boolean=Boolean], [consideringParentsShear:Boolean=Boolean])

Shear the page item

Parameter

Type

Description

by

Number

Angle by which to shear the object

around

Array of 2 Units

AnchorPoint

AnchorPoint.BOTTOM_CENTER_ANCHOR

AnchorPoint.BOTTOM_LEFT_ANCHOR

AnchorPoint.BOTTOM_RIGHT_ANCHOR

AnchorPoint.CENTER_ANCHOR

AnchorPoint.LEFT_CENTER_ANCHOR

AnchorPoint.RIGHT_CENTER_ANCHOR

AnchorPoint.TOP_CENTER_ANCHOR

AnchorPoint.TOP_LEFT_ANCHOR

AnchorPoint.TOP_RIGHT_ANCHOR

The point to shear around. Can accept: Array of 2 Units or AnchorPoint enumerator. (Optional)

shearAxisAngle

Number

The amount that the shear axis is rotated. If 0 degree then shear at its horizontal axis. If 90 degrees then shear at the vertical axis. (Optional)

(default: 0)

consideringCurrentShear

Boolean

If true then the object's current shear and new shear will be combined. If false then the new value is absolute. The default value is false. (Optional)

(default: false)

transformingContent

Boolean

If true then both the object and items within it are sheared (Optional)

(default: true)

consideringParentsShear

Boolean

If true then the object is sheared relative to its parent page item. If false it is sheared relative to the spread. Cannot shear with considering current shear and considering parents shear both set at the same time. (Optional)

(default: false)

String toSource ()

Generates a string which, if executed, will return the Graphic.

String toSpecifier ()

Retrieves the object specifier.

String transformAgain ()

Transforms the Graphic using the last transformation performed on any object. Transformations include moving, rotating, shearing, scaling, and flipping.

String transformAgainIndividually ()

Transforms the Graphic using the last transformation performed on any Graphic. Transformations include moving, rotating, shearing, scaling, and flipping.

String transformSequenceAgain ()

Transforms the Graphic using the last sequence of transform operations performed on any single object or performed at the same time on any group of objects. Transformations include moving, rotating, shearing, scaling, and flipping.

String transformSequenceAgainIndividually ()

Transforms the Graphic using the last sequence of transformations performed on any single object or performed at the same time on any group of objects. Transformations include moving, rotating, shearing, scaling, and flipping.

Object of

FormField.overriddenMasterPageItem

Button.overriddenMasterPageItem

Movie.overriddenMasterPageItem

Sound.overriddenMasterPageItem

PageItem.overriddenMasterPageItem

Oval.overriddenMasterPageItem

Rectangle.overriddenMasterPageItem

GraphicLine.overriddenMasterPageItem

Polygon.overriddenMasterPageItem

Group.overriddenMasterPageItem

Image.overriddenMasterPageItem

EPS.overriddenMasterPageItem

PDF.overriddenMasterPageItem

WMF.overriddenMasterPageItem

PICT.overriddenMasterPageItem

Graphic.overriddenMasterPageItem

Guide.overriddenMasterPageItem

TextFrame.overriddenMasterPageItem

Button.allGraphics

Cell.allGraphics

Character.allGraphics

Document.allGraphics

Footnote.allGraphics

FormField.allGraphics

GraphicLine.allGraphics

Group.allGraphics

InsertionPoint.allGraphics

Layer.allGraphics

Line.allGraphics

MasterSpread.allGraphics

Oval.allGraphics

Page.allGraphics

PageItem.allGraphics

Paragraph.allGraphics

Polygon.allGraphics

Rectangle.allGraphics

Spread.allGraphics

Story.allGraphics

Table.allGraphics

Text.allGraphics

TextColumn.allGraphics

TextFrame.allGraphics

TextStyleRange.allGraphics

Word.allGraphics

Return

Graphics.anyItem()

Graphics.everyItem()

Graphics.nextItem()

Graphics.previousItem()

Graphics.itemByID()

Graphics.item()

Graphics.itemByName()

Graphics.itemByRange()

Graphics.firstItem()

Graphics.lastItem()

Graphics.middleItem()