Skip to main content
Inspiring
October 15, 2009
Answered

Resizing a page from the bottom edge

  • October 15, 2009
  • 2 replies
  • 4250 views

I have a document where my client has requested that the pages be shortened by 30mm in height. The width of the page stays the same. If I enter a new page size for the document, Indesign adjusts it from the centre of the page, but is there a way to get it to adjust it from the bottom edge? In other words to effectively get the top 30mm trimmed off the page.

None of my artwork encroaches into the top 30mm, but it does get close to the bottom edge. If I could shave the top off the page like this then I wouldn't have to move anything, but with the default behaviour I will have to adjust every page. Is this sort of thing possible?

Thanks

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

Thanks Harbs, that did the trick!

Can I please just ask for one more thing - is it possible to get it to adjust master page items as well. All my page numbers got left behind off the bottom of the page

Thanks


The truth of the matter is that the script was unnessesarily complicated. Marc had the right idea. This should get master page items as well (although it's totally untested):

var myDoc = app.activeDocument;
myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters;
myDoc.documentPreferences.pageHeight -= 30;     //*** Make DOC 30mm shorter

   myPIs = myDoc.pageItems.everyItem();
   myPIs.locked = false;
   myPIs.move(undefined, [0,-15]);

Harbs

2 replies

October 15, 2009

Someone else replied more quickly. But they did not address masterPage elements as well as locked pageItems.

Yes you can using a script. After resizing the document, you will have to step through each page, select ALL, and move them but 15mm UP.

============================

var myDoc = app.activeDocument;

myDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.millimeters;
myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters;

myDoc.documentPreferences.pageHeight -= 30;     //*** Make DOC 30mm shorter

for (cpt = 0; myDoc.pageItems.length; cpt++)     //*** UNLOCK all pageItems

  myDoc.pageItems[cpt].locked = false;

var myPGS = mydoc.pages;

for (cptPG = 0; cptPG < myPGS.length; cptPG++)

{

  app.select(NothingEnum.nothing);    //*** IMPORTANT in CS2 anyway. Can't remember why***

  myDoc.layoutWindows[0].activePage = myPGS[cptPG];    //*** IMPORTANT

  OverrideMasterPageItems (myPGS[cptPG]);     //*** IMPORTANT

  app.select(SelectAll.all);

  var myITM = myDoc.groups.add(app.selection);
  myITM.move(undefined, [0,-15]);
  myITM.ungroup();

}

===================

This is a modified script I use every day to optimize page height for film output. It keeps element centered to where they were.

I added UNLOCK in case you did have elements locked!!!

I did NOT test it...

Harbs.
Legend
October 15, 2009

You're much better off avoiding select().

I'd do something like this:

Harbs

http://www.in-tools.com

Innovations in Automation

October 15, 2009

Cool Harbs. THis is an old script. And Yes I prefer not using select nowadays.

Also you skip the grouping. I was wondering why I am doing it?

Thx, Alex.

PS. How do you do the code insert wihtin a window?

2nd could you check this thread I've posted?

http://forums.adobe.com/thread/507105?tstart=0

Marc Autret
Legend
October 15, 2009

Once the page is resized, why don't you offset the objects by 15 mm vertically?

var p, pItems = app.activeDocument.pageItems.everyItem().getElements();
while(p=pItems.pop()) p.move(undefined,[0,'15 mm']);

Edit: using allPageItems was not correct.