Class: PageNode
A PageNode represents a page in the document, a child of the root node of the document's "scenegraph" artwork tree (see ExpressRootNode). A page contains one or more artboards, which in turn contain all the page's visual content. If multiple artboards are present, each represents a keyframe "scene" in the page's animation timeline.
To create new pages, see PageList.addPage.
Extends
Extended by
Implements
Constructors
Constructor
new PageNode(): PageNode;
Returns
PageNode
Inherited from
Accessors
addOnData
Get Signature
get addOnData(): AddOnData;
Get AddOnData reference for managing the private metadata on this node for this add-on.
Returns
Inherited from
id
Get Signature
get id(): string;
A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is moved to a different part of the document.
Returns
string
Inherited from
type
Get Signature
get type(): SceneNodeType;
The node's type.
Returns
Inherited from
parent
Get Signature
get parent(): BaseNode | undefined;
The node's parent. The parent chain will eventually reach ExpressRootNode for all nodes that are part of the document content.
Nodes that have been deleted are "orphaned," with a parent chain that terminates in undefined without reaching the root node. Such nodes cannot be selected, so it is unlikely to encounter one unless you retain a reference to a node that was part of the document content earlier. Deleted nodes can be reattached to the scenegraph, e.g. via Undo.
Returns
BaseNode | undefined
Inherited from
width
Get Signature
get width(): number;
The width of the node.
All Artboards within a page share the same dimensions, so changing this value will also automatically adjust the size of every child ArtboardNode.
Note: changing the page's size does not adjust the size or position of any of visual content inside any child ArtboardNode. Callers should use their own layout logic to update the content for the new bounds as desired. For example, making the size smaller could result in content being clipped and hard to access if it is not adjusted to be visible again.
Must be at least MIN_PAGE_DIMENSION and no larger than MAX_PAGE_DIMENSION.
Returns
number
Set Signature
set width(value): void;
Parameters
valuenumberReturns
void
Implementation of
height
Get Signature
get height(): number;
The height of the node.
All Artboards within a page share the same dimensions, so changing this value will also automatically adjust the size of every child ArtboardNode.
Note: changing the page's size does not adjust the size or position of any of visual content inside any child ArtboardNode. Callers should use their own layout logic to update the content for the new bounds as desired. For example, making the size smaller could result in content being clipped and hard to access if it is not adjusted to be visible again.
Must be at least MIN_PAGE_DIMENSION and no larger than MAX_PAGE_DIMENSION.
Returns
number
Set Signature
set height(value): void;
Parameters
valuenumberReturns
void
Implementation of
name
Get Signature
get name(): string | undefined;
The page's name. Displayed as a user-editable label above the current artboard in the UI.
Returns
string | undefined
Set Signature
set name(name): void;
Parameters
namestring | undefinedReturns
void
Methods
removeFromParent()
removeFromParent(): void;
Removes the node from its parent - effectively deleting it, if the node is not re-added to another parent before the document is closed.
If parent is a basic ContainerNode, this is equivalent to node.parent.children.remove(node). For nodes with other child "slots," removes the child from whichever slot it resides in, if possible. Throws if the slot does not permit removal. No-op if node is already an orphan.
Returns
void