Copy link to clipboard
Copied
I'm trying to change the dimensions of the second page in my indesign document so it's a custom size, but not having any luck. Is it even possible. What would be the method?
Hi @davidn5918184 , Look at the page resize() method:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Page.html#d1e203601__d1e205188
var p = app.activeDocument.pages[1],
w = 400,
h = 700;
//the resize method expects points unless you set the 6th parameter to true, which uses ruler units
p.resize (CoordinateSpaces.INNER_COORDINATES,AnchorPoint.CENTER_ANCHOR,ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,[w,h])
Copy link to clipboard
Copied
Hi @davidn5918184 , Look at the page resize() method:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Page.html#d1e203601__d1e205188
var p = app.activeDocument.pages[1],
w = 400,
h = 700;
//the resize method expects points unless you set the 6th parameter to true, which uses ruler units
p.resize (CoordinateSpaces.INNER_COORDINATES,AnchorPoint.CENTER_ANCHOR,ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,[w,h])
Copy link to clipboard
Copied
Awesome, thank you!
var secondPage = app.activeDocument.pages[1];
var newWidth = 1080;
var newHeight = 1920;
// Resize the second page
secondPage.resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.CENTER_ANCHOR, ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, [newWidth, newHeight], true);