Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

How to get Geometric Bounds of a Table

Contributor ,
May 12, 2016 May 12, 2016

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

TOPICS
Scripting

Views

666
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , May 12, 2016 May 12, 2016

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

Votes

Translate
Guru ,
May 12, 2016 May 12, 2016

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 12, 2016 May 12, 2016

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2016 May 12, 2016

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:

Tables-WorstCaseScenario-1.png

Uwe

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

LATEST

Yep, I knew there were complicate cases and worst case scenarios, I was going for the best case simple scenarios

Hope that helps Kurtis

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 12, 2016 May 12, 2016

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

baseline

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 12, 2016 May 12, 2016

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines