Skip to main content
Inspiring
September 25, 2014
Question

Where can I map the translate values of the tranformation matrix in a document?

  • September 25, 2014
  • 1 reply
  • 710 views

Hi All,

I have been looking into the transformation matrix of InDesign for a day now. Had great help from http://www.indiscripts.com/blog/public/data/coordinate-spaces-and-transformations-1/CoordinateSpacesTransfos01_KeyConcep…

I am executing the following script to get the transformation matrix of a page-item.

var pageItem = app.activeDocument.pageItems.item(0);

mx = pageItem.transformValuesOf(CoordinateSpaces.parentCoordinates)[0];

alert( mx.matrixValues );

Now on executing the above I am able to understand how the 'a', 'b', 'c', 'd' values are calculated. But I do not have an understanding on the 'e', 'f' values that represent the horizontal and vertical translations respectively.

Can anyone tell me what these values represent on the InDesign document?

Thanks!

This topic has been closed for replies.

1 reply

Community Expert
September 27, 2014

Read it again. ;-) (and again…)

From the pdf by Marc Autret:

The linear component — a,b,c,d — typically allows to apply scaling, flipping, rotation, or skew, around the origin of the input coordinate system, while the translation component — e,f — allows to reposition the result within the destination space.

(my emphasis)

e for x direction

f for y direction

Uwe

Marc Autret
Legend
September 28, 2014

Hi all,

Thanks Uwe ;-)

Anyway poortip87's question definititely makes sense (and will be answered in Chapter 2).

In short: even when you know that (e,f) represent some (tx,ty) translation components which actually regulate the positioning within the parent space, the problem remains of determining where is the origin of a PageItem inner space. One might intuitively expect a simple rule based on some bounding box center point. However, this is not the case. The implicit origin of a PageItem inner space is absolutely determined as the origin of the pasteboard coordinate space, whatever the actual location of that graphic object in the document. Therefore the (e,f) values are somewhat frustrating: they give you the location of the PageItem inner space origin relative to the parent space, but you still don't know where the object "in itself"—that is, its visible bounding box—is located. Chapter 2 will explore InDesign's specific coordinate spaces and these related issues…

@+

Marc

Community Expert
September 28, 2014

@Marc – yes, but one can resolve() the pageItem and check its position according to the Pasteboard Coordinate Space (and that is describing the Coordinate Space of the whole document). So, if you know on what spread the pageItem is positioned you can use the position of one of its path points in Pasteboard Coordinate Space and compare that to any parameter the user has chosen for meassurement units in horizontal or vertical direction and the current zero point.

At least I think so… ;-)

Of course might be, that a script has fooled around with Pasteboard Coordinate Space…
(Will think that through again when I have more time for it)

Uwe