Copy link to clipboard
Copied
hi all,
i was trying to figure out how to convert the idml coordinates to pixels.... say this piece of code from the cookbook.
<TextFrame Self="textframe1" ParentStory="story1" ContentType="TextType"
ItemTransform="1 0 0 1 -612 -396">
<Properties>
<PathGeometry>
<GeometryPath PathOpen="false">
<PathPointArray>
<PathPoint Anchor="36 36" LeftDirection="36 36"
RightDirection="36 36"/>
<PathPoint Anchor="36 186" LeftDirection="36 186"
RightDirection="36 186"/>
<PathPoint Anchor="172 186" LeftDirection="172 186"
RightDirection="172 186"/>
<PathPoint Anchor="172 36" LeftDirection="172 36"
RightDirection="172 36"/>
</PathPointArray>
</GeometryPath>
</PathGeometry>
</Properties>
</TextFrame>
where exactly is the textframe?
tks.
Copy link to clipboard
Copied
These values really look like points.
The text frame is defined by its anchor points. The LeftDirection/RightDirection values are the same as its anchor, indicating a straight line (if either value is something else, the point would be a curved point). So the text frame coordinates are simply (36,36), (36,186), (172,186), (172,36) -- a rectangle with its corners on (36,36) and (172,186). You can verify this by checking the document in InDesign (with the measurement units set to points).
I'm not considering any effect of the transformation matrix given in the first line. I wonder what it is for, though -- it smells like an inversion of the zero point (math not checked!).
You cannot "convert" these values to pixels, because InDesign does not use pixels as a measurement -- anywhere. Only when the text frame is imaged onto the screen, some pixel value will be needed, and then those will be relative to the upper left of the view screen and scaled to the user's current view setting.
A commonly used shortcut is to treat points as pixels, but that's not based on anything real, just 'for convenience'.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more