Skip to main content
Inspiring
December 6, 2010
Answered

How to get page bottom marinn

  • December 6, 2010
  • 2 replies
  • 977 views

Hi all,

I want to place my text frame below my master spread on slug area at fixed position.

But I have different page sizes documents. How can I define text frame position with my master spread bottom margin so that I can use only one script for all my documents?

Please give me a code/sample.

Thanks,

Mon

This topic has been closed for replies.
Correct answer Harbs.

Thanks Herbs, but it gives error "getBottomMarginPosition is not a function".

Please help.


You need to copy the function from above...


2 replies

Harbs.
Legend
December 6, 2010

function getBottomMarginPosition(page){

return page.bounds[2] - page.marginPreferences.bottom;

}

Harbs

Inspiring
December 6, 2010

Thanks for your reply on this.

How can I use your code in my script. Please guide me. See my code below:

var myLayer=myDocument.layers[1];


var myMasterSpread = myDocument.masterSpreads.item(0);


var myLeftPage = myMasterSpread.pages.item(0);


var myLeftSlug = myLeftPage.textFrames.add();


myLeftSlug.itemLayer=myLayer;


myLeftSlug.geometricBounds = [255, 0, 258, 80];

I need to replace my Top value with page bottom margin + 1mm. So that my text frames sit on my slug area.

Thanks,

Mon

Harbs.
Legend
December 6, 2010

var bot = getBottomMarginPosition(myLeftPage);

myLeftSlug.geometricBounds = [bot, 0, bot+3, 80];

Harbs

Inspiring
December 6, 2010

Hi Mon,

Look at the marginPreferences property...

var TopValue = myCurrentPage.marginPreferences.top;

var BottomValue = myCurrentPage.marginPreferences.bottom;

John