You should take a look at AIHardSoftSuite. This suite provides functions for converting between different coordinate systems used at different levels of Illustrator. The geometry of an object is described by coordinates that are relative to a pair of imaginary axes imposed on the artboard. Illustrator uses two ways of placing these axes; one for storing coordinate information internally, and another for passing coordinate information across the SDK functions. In the internal coordinate system, the origin is the top left corner of the artboard--that is, of the white area that can be seen when zoomed out as far as possible. The X axis is horizontal, with the values increasing to the right. The Y axis is vertical, with values increasing downward. Values in this system are called \e hard, or \e artboard coordinates. In the public coordinate system, the origin is the \e ruler origin--that is, the point that corresponds to the 0 marks on the ruler when it is visible. By default, it is the bottom left corner of the page, but it can be changed by the user. The X axis is horizontal, with the values increasing to the right. The Y axis is vertical, with values increasing upward. Values in this system are called \e soft, or \e page coordinates. Most functions in the SDK use the public system of page coordinates, but some use the internal artboard coordinates. This suite provides functions for mapping between the coordinate systems. For example, if you pass the origin point, [0,0], to \c #AIRealPointHarden(), the function returns the vector from the artboard origin (the top left of the canvas) to the page origin (the bottom left of the visible page). These matrix conversion functions do not convert all components of translation matrices. To do this, you must understand the details of the two coordinate systems involved and use linear algebra. You must analyzed each case. For example, the matrix stored in an \c #AIPatternStyle maps coordinates from pattern space to internal artboard space, whereas the matrix for an image maps from image space to public page space. Thomas.
... View more