I need to get the offset of a placed PDF inside of the container rectangle. I have figured out that this information should be available in the transformationMatrix of the placed file. So I do something like:
var pdfTransform = pdf.transformValuesOf(CoordinateSpaces.pasteboardCoordinates)[0];
var horzTranslation = pdfTransform.horizontalTranslation;
var vertTranslation = pdfTransform.verticalTranslation;
but the coordinates I get back are just weird. The horizontal value seems reasonable, but the vertical is way off what I expect.
There may be some precondition to doing this that I'm missing. Running the pageitems/TransformValuesOf.jsx sample from the Scripting Guide also gives weird values. That sample creates a rectangle with a center point of [0, 0] and then retrieves the transform. I would expect the translation to be [0, 0] but I actually get [5, -415.95] (horz, vert).
In that sample it talks about ruler coordinates, so I tried setting document.viewPreferences.rulerOrigin to different values, but that does nothing.
I'm stumped. Can someone please give me a hint on what's going on here?