Rotate a rectangle "myRectangle" around its center point.var myRotateMatrix = () var myRectangle = (0).em(0).em(-1) var myNewRectangle = myRectangle.duplicate() (For the complete script, see TransformExamples.) The following scripting example demonstrates the basic process of transforming a page item. For more on specifying the transformation origin, see Transformation Ori-gin on page 6. In addition, you specify the center of transformation, or transformation origin. For more on coordi-nate systems, see Coordinate Spaces on page 5. When you do this, you also specify the coordinate system in which the transformation is to take place. Apply the transformation matrix to the object using the transform method. To transform an object, you follow two steps:Ģ. Applying transformations in differing orders can produce very different results. The order in which transformations are applied to an object is important. A transformation matrix can contain any combination of scale, rotate, shear, or translate operations, in any order.
Using the Transform MethodThe transform method requires a transformation matrix (transformationMatrix) object that defines the transformation or series of transformations to apply to the object. This document assumes you have a basic working knowledge of InDesign scripting.
This document shows you how to transform objects in InDesign CS3 and discusses some of the technical details behind the new transformation architecture. This one method replaces the resize, rotate, and shear methods used in previous versions of InDesign. In Adobe InDesign CS3 scripting, you apply transformations using the transform method. Transformations include scaling, rotation, shearing (skewing), and movement (or translation). Operations that change the geometry of items on an InDesign page are called transformations.
The software described in this document is furnished under license and may only be used or copied in accordance with the terms of such license.Īdobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies that may appear in this document. The information in this document is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. All other trademarks are the property of their respective owners.
All rights reserved.Īdobe, the Adobe logo, and InDesign are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. ADOBE INDESIGN CS3 SCRIPTING:WORKING WITH TRANSFORMATIONSĪdobe InDesign CS3 Scripting: Working with Transformations in JavaScriptĢ007 Adobe Systems Incorporated.