3 Replies Latest reply: Jul 30, 2012 8:02 PM by Bill joy RSS

    Object coordinates

    Bill joy Community Member

      Hi

       

      I want to know about indesign object coordinates.

      In .indd file coordinates take 32 byte for any coordinate for top, left, bottom, right or (x, y, width, height).

      How calculate x and y value from these 8-8 byte.It contain floting value but not follow IEEE standered.

      What format use to store coordinate in indesign .indd file.

      When I create a text frame in indesign on first page using Facing option whose value are

      X=0, Y=0, Width=50,Height=50 and ruler is set on (0,0).I am not using any rotation.

      Then I find the 32 byte for this in .indd file

      00 00 00 00 00 00 22 C0

      67 BD 78 7C 6C 91 7A C0

      EE 76 BB DD 6E D7 62 40

      F0 01 9B CD 66 63 71 C0

      How calculate x , y width, height value from these hex byte.

      What standered use by indesign to store coordinate.

      Is there is any function in sdk that take these hex value and return coordinate.

       

      Thanks

        • 1. Re: Object coordinates
          [Jongware] MVP

          Bill joy wrote:

           

          How calculate x and y value from these 8-8 byte.It contain floting value but not follow IEEE standered.

           

          But it does follow an IEEE standard: "IEEE 754 double-precision binary floating-point format: binary64".

          Mind the byte order; the 8 bytes are stored according to the endianness as declared in your file header.

           

          Bill joy wrote:

           

          Is there is any function in sdk that take these hex value and return coordinate.

           

          There is none, for several reasons. First off, InDesign (naturally!) does not work with 'hex values'. As stated above, double floating point values are stored in their native binary format and also read as such. There is no 'conversion' of any kind necessary (apart from endianness differences, then).

          Since these are plain, pure floating point numbers, they do not "return" coordinates -- just like the single number "2,000,000" can represent either the number of megabytes on my external backup disk or the number of euros in my bank account. It's just a number.

           

          Furthermore, I believe the SDK is meant to allow the user handle high level operations and data such as coordinates transparently; the way the actual bytes are stored in memory is practically irrelevant, for any regular operation.

          • 2. Re: Object coordinates
            Bill joy Community Member

            Hi  Jongware

            Thanks for Reply

             

            According you i try to convert these byte using double-precision binary floating point format but i am not getting my answer.

            I am sending some screen shot of these byte. Plz help me  to get  x and y coordinate.

            I am creating textframe in indesign using Facing with default setting and set x=0 mm , y=0 mm,w=50 mm, h=50 mm for textframe.

            and get hex value

            x = 00000000000022c0 // (after converting in double-precision binary floating point i get  -8)

            y =67bd787c6c917ac0   //(after converting in double-precision binary floating point i get  -425.088985892906)

            w =(EE76BBDD6ED76240 - 00000000000022C0) //(after converting EE76BBDD6ED76240  in double-precision binary floating point i get  150.732283464567)

            H= (F0019BCD666371C0 - 67bd787c6c917ac0) //(after converting F0019BCD666371C0  in double-precision binary floating point i get  -278.212598424433)

             

            According my information

             

            InDesign  coordinates are measured relative to the current location of the ruler’s zero point; the vertical (Y-axis) coordinates below the zero point are positive numbers; coordinates above the zero point are negative numbers.

             

            When you get or set  the location of a path point, the coordinates are passed and returned in the typical (x, y) order. InDesign returns some coordinates in a different order, however, and it expects you to supply them in that order. Geometric bounds and visible bounds are arrays containing four coordinates, which define (in order) the top, left, bottom, and right edges of the object’s bounding box,  (y1, x1, y2, x2).

             

             

             

            I am not understand that i follow the right approch Plz help me  as soon as possible.

             

            I am waiting for your reply.

             

             

             

            Thanks

            • 3. Re: Object coordinates
              Bill joy Community Member

              Hi Jongware

               

              If these coordinate system follow an IEEE standard then according me X and Y coordinate hex value should be 0000000000000000  because i an setting X and Y value 0 mm.

              My Document setting  is Page Size A4, Width 210 mm and Height 297 mm, columns number 1, Gutter 4.233 mm, Margins top, bottom, inside, Outside is 12.7 mm, Bleed and slug 0 mm.

               

              Page Ruler is set at (0,0) and reference point is set at (top, left).

              According this setting page coordinate in .indd file are

               

              00000000000000C0   // (after converting in double-precision binary floating point i get  -2)

              67BD783C1E6F7AC0

              0E9DD16834C28240

              67BD783C1E9F7A40

               

              and Spread coordinate are

               

              0E9DD168349A92C0

              67BD783C1ECF7EC0

              0E9DD168349A9240

              67BD783C1ECF7E40

               

              Is there is any use of page or spread coordinate to get the object coordinate plg tell me.

               

               

              Thanks