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

How to measure the space between the last line and bottom margin

Community Beginner ,
Sep 12, 2018 Sep 12, 2018

Copy link to clipboard

Copied

Hi All,

I have 1000+ page document and now I am forced to measure the space between the last line and bottom margin of each page.

Is there a way to do automate it by JS?

I am unable to get the last line base line postion in javascript.

Please help me get this parameter

TOPICS
Scripting

Views

416

Translate

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

Community Expert , Sep 13, 2018 Sep 13, 2018

Hi prtamil ,

if the bottom margin of the page is meant and not the bottom edge of the text frame, then do:

// text frame selected:

var frame = app.selection[0];

var gap = frame.parentPage.bounds[2] - frame.parentPage.marginPreferences.bottom - frame.lines[-1].baseline;

Regards,
Uwe

Votes

Translate

Translate
Community Expert ,
Sep 12, 2018 Sep 12, 2018

Copy link to clipboard

Copied

gap = myFrame.geometricBounds[2] - myFrame.lines[-1].baseline

Votes

Translate

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 ,
Sep 13, 2018 Sep 13, 2018

Copy link to clipboard

Copied

LATEST

Hi prtamil ,

if the bottom margin of the page is meant and not the bottom edge of the text frame, then do:

// text frame selected:

var frame = app.selection[0];

var gap = frame.parentPage.bounds[2] - frame.parentPage.marginPreferences.bottom - frame.lines[-1].baseline;

Regards,
Uwe

Votes

Translate

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