Last active
August 29, 2015 14:03
-
-
Save grefel/2e03c6c286e87ef0d667 to your computer and use it in GitHub Desktop.
Get type area from page #indesign #js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getTypeArea(page) { | |
typeArea = {}; | |
typeArea.y1 = page.marginPreferences.top; | |
typeArea.x1 = page.side == PageSideOptions.LEFT_HAND ? page.marginPreferences.right : page.marginPreferences.left; | |
typeArea.y2 = page.bounds[2] - page.marginPreferences.bottom; | |
typeArea.x2 = page.side == PageSideOptions.LEFT_HAND ? page.bounds[3] - page.marginPreferences.left : page.bounds[3] - page.marginPreferences.right; | |
typeArea.geometricBounds = [typeArea.y1, typeArea.x1, typeArea.y2, typeArea.x2] | |
typeArea.height = typeArea.y2 - typeArea.y1; | |
typeArea.width = typeArea.x2 - typeArea.x1; | |
return typeArea; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment