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(
VariableTypeUtils.createEnumeration(kAnchorPointTopLeftAnchor.value),
kCoordinateSpacesSpreadCoordinates.value,
OptArg.noBoolean());
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.
To retrieve the coordinates top left anchor point of a page item I use the following code:
topLeftCoordinate = this.idsPageItem.resolve(
VariableTypeUtils.createEnumeration(kAnchorPointTopLeftAnchor.value),
kCoordinateSpacesSpreadCoordinates.value,
OptArg.noBoolean());
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.