User Guide
202 Chapter 5: Fireworks JavaScript API
Description
Sets the canvas color of the document to the specified color.
Example
The following command sets the canvas color to blue.
fw.getDocumentDOM().setDocumentCanvasColor("#0000ff");
dom.setDocumentCanvasSize()
Availability
Fireworks 3.
Usage
dom.setDocumentCanvasSize(boundingRectangle)
Arguments
boundingRectangle
A rectangle that specifies the new canvas size for the document, in pixels
(see “Rectangle data type” on page 11). Any items outside the specified rectangle are removed.
Returns
Nothing.
Description
Sets the document’s canvas size to the specified rectangle.
Example
The following command sets the canvas to a size of 200 by 200 pixels.
fw.getDocumentDOM().setDocumentCanvasSize({left:150, top:150, right:350,
bottom:350});
dom.setDocumentCanvasSizeToDocumentExtents()
Availability
Fireworks 3.
Usage
dom.setDocumentCanvasSizeToDocumentExtents(bGrowCanvas)
Arguments
bGrowCanvas
If bGrowCanvas is true, the canvas can expand or shrink in size. If bGrowCanvas
is
false, it only shrinks.
Returns
Nothing.
Description
Calculates the size of all the items in the document and resizes the document canvas to that size.
This action is the same behavior as Modify > Trim Canvas.