1 Reply Latest reply on Nov 24, 2008 10:46 AM by (Olav_Kvern)

    Y coordinate of top left anchor point issue

      I'm writing a Java app against the prerelease version of InDesign Server CS4.
      To retrieve the coordinates top left anchor point of a page item I use the following code:

      topLeftCoordinate = this.idsPageItem.resolve(
      double originX = topLeftCoordinate.asList()[0].asList()[0].asDouble();
      double originY = topLeftCoordinate.asList()[0].asList()[1].asDouble();

      The X coordinate is returned correctly, but the Y coordinate seems to be relative to the center of the page! If I add half of the page height to originY I get the value I expect.

      Is there a logical explanation for this behavior?

      Thanks in advance.
        • 1. Re: Y coordinate of top left anchor point issue
          Level 1
          Hi Chris,

          The origin of the spread coordinate system(kCoordinateSpacesSpreadCoordinates)is at the center of the spread. None of the coordinate systems used by resolve() match what you see on the rulers.

          If you know that the page item has not been transformed, you can use the geometricBounds of the page item to get the location in ruler coordinates. You could also use the anchor property of an individual path point.