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.
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.
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)
and Spread coordinate are
Is there is any use of page or spread coordinate to get the object coordinate plg tell me.