Copy link to clipboard
Copied
I've searched the DOM and forum and can't find any information on getting the geometric bounds of a table. How can I achieve this? Kurtis
Hi Kurtis
Get the tables width and height and the horizontal and vertical offsets of it's containing character and you should be able to calculate it.
Trevor
Copy link to clipboard
Copied
Hi Kurtis
Get the tables width and height and the horizontal and vertical offsets of it's containing character and you should be able to calculate it.
Trevor
Copy link to clipboard
Copied
You might want to take into account, that a table could run over multiple textframes when they are linked.
Thanks Stefan
Copy link to clipboard
Copied
Hi Trevor,
there are other factors as well:
Very likely:
The alignment of the character* as part of a paragraph.
Is the table threaded to another text frame?
If yes, the character* is meaningless for all parts of a table not with the first row.
More exotic factors:
Rotation angle of the text frame holding the table or parts of it.
Shear angle of the text frame holding the table or parts of it.
* the character that is holding the table
Others?
Well, yes…
Here a first worst case scenario.
Watch the inset values of the selected text frame and the rendered insets that will not fit together very well:
Uwe
Copy link to clipboard
Copied
Yep, I knew there were complicate cases and worst case scenarios, I was going for the best case simple scenarios
Hope that helps Kurtis
Copy link to clipboard
Copied
Hey Trevor, Thanks for the quick reply. How do I get the vertical offset? There's an explicit property for horizontal but not vertical. Any ideas? Cheers, Kurtis
Copy link to clipboard
Copied
baseline
Copy link to clipboard
Copied
Hi,
like this you can get the insertionPoint before and after the table. The property you need is called "storyOffset":
var firstInsertionPoint = curTable.storyOffset;
var curParentStory = firstInsertionPoint.parentStory;
var lastInsertionPoint = curParentStory.insertionPoints.nextItem(firstInsertionPoint);
Thanks Stefan