Skip to main content
Participant
March 13, 2012
Question

How to find out the coordinates of pageitems

  • March 13, 2012
  • 1 reply
  • 3240 views

Hi,

I designed a demo file in Indesign with a rectangle.

 

Pagesize: 85mm x 55mm

Rectangle: x=42,375mm, y=27,458mm, width: 58,417mm, height=28,417mm

In the next step I did an idml export.

Spread.xml:

...

<Rectangle Self="ud8" ... ItemTransform="1 0 0 1 0 0">

    <Properties>

         <PathGeometry>

            <GeometryPathType PathOpen="false">

<PathPointArray>

<PathPointType Anchor="-82.6496062992126 -39.893700787401585" LeftDirection="-82.6496062992126 -39.893700787401585" RightDirection="-82.6496062992126 -39.893700787401585"/>

<PathPointType Anchor="-82.6496062992126 39.65748031496063" LeftDirection="-82.6496062992126 39.65748031496063" RightDirection="-82.6496062992126 39.65748031496063"/>

<PathPointType Anchor="81.94094488188978 39.65748031496063" LeftDirection="81.94094488188978 39.65748031496063" RightDirection="81.94094488188978 39.65748031496063"/>

<PathPointType Anchor="81.94094488188978 -39.893700787401585" LeftDirection="81.94094488188978 -39.893700787401585" RightDirection="81.94094488188978 -39.893700787401585"/>

</PathPointArray>

...

I do not understand how to calculate the  x, y  coordinates which are shown in indesign!?

I tried to understand the matrix calculation which is described in the IDML reference on page 98. http://wwwimages.adobe.com/...ml-specification.pdf

| a b 0 |    | x |            | 1 0 0 |      | -82.6496062992126    |             | -82.6496062992126    |

| c d 0 | *  | y |     -->   | 0 1 0 |  *  | -39.893700787401585 |    -->     | -39.893700787401585 |

| e f  1 |    | 1 |            | 0 0 1 |     | 1                               |              | 1                               |

😞   That does not correspond to the display coordinates in Indesign   ( x=42,375mm, y=27,458mm)

Can anybody help?

THANKS!

This topic has been closed for replies.

1 reply

John Hawkinson
Inspiring
March 13, 2012

Screenshot of the ID UI with the coordinates displayed is probably a good idea here so we can see what you're talking about.

But fundamentally, IDML coordinates are in pasteboard-relative points with a zero point in the upper left.

In the ID UI, the zero point is elsewhere, depending. It may be custom, spine-relative, or page-relative.

So you'll need to apply a translation to the zero point.

Participant
March 14, 2012

Yes but I don't understand how to translate the coordinates to zero point.

Here ist the screen. The rectangle is the green area.

John Hawkinson
Inspiring
March 15, 2012

It seems pretty straightforward to me.

Your center point is (42.375 mm, 27.458 mm) and your box is 58.417 mm x 28.417mm.

IDML defines the rectangle by its corners, not its center, so let's find the upper-left corner. Divide the width by two and subtract from the x, same for the height and the y. You get (13.665 mm, 13.2495 mm).

That is in page coordinates relative to the upper-left corner of the page, we can see from your rulers.

But IDML coordinates are spread-relative from the center of the spread. Your spread is a single page that is 85 mm x 55 mm.

So if we translate your upper-left corner, it is (13.665, 13.2495) mm - (85/2, 55/2) => (29.3335 mm, 14.2505mm) in spread-relative coordinates.

But IDML coordinates are in points, not in mm. So we convert (multiply by 2.835). And we get (83.150 pt, 40.395 pt).

But that doesn't match up with your IDML file, which has  (-82.650 pt, -39.890pt).

But look at the difference: (0.500 pt, 0.505 pt). That's really 1/2 point, because your box has a 1-pt border and that gets split evenly across all 4 sides. And there's 0.005 of round-off error, bceause floating point math sucks.

Any questions?