Highlighted

How set margins in new dcoument (script)

Participant ,
May 29, 2020

Copy link to clipboard

Copied

Hi,

I create new doc. Can't set margins of new doc. Last line (code: margins) does not work ... wrong place I suppose, but can't find where else to set margins for whole doc (like I can do in: New Document / Document Preset.. see screenShot).

code:

var myDocument = app.documents.item(0);
with(myDocument.documentPreferences){
pageHeight = "430mm";
pageWidth = "266mm";
pageOrientation = PageOrientation.portrait;
pagesPerDocument = 12;
documentBleedTopOffset = "3mm";
documentBleedUniformSize = true;
facingPages = false;
intent = DocumentIntentOptions.PRINT_INTENT;
marginPreferences.properties= {top : 80,left: 80,right: 80,bottom: 80};
}

Z-margin.jpg

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

try marginPreferences property present on document, it has these option. Look at the following

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#MarginPreference.html

 

-Manan

TOPICS
Scripting

Views

306

Likes

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

How set margins in new dcoument (script)

Participant ,
May 29, 2020

Copy link to clipboard

Copied

Hi,

I create new doc. Can't set margins of new doc. Last line (code: margins) does not work ... wrong place I suppose, but can't find where else to set margins for whole doc (like I can do in: New Document / Document Preset.. see screenShot).

code:

var myDocument = app.documents.item(0);
with(myDocument.documentPreferences){
pageHeight = "430mm";
pageWidth = "266mm";
pageOrientation = PageOrientation.portrait;
pagesPerDocument = 12;
documentBleedTopOffset = "3mm";
documentBleedUniformSize = true;
facingPages = false;
intent = DocumentIntentOptions.PRINT_INTENT;
marginPreferences.properties= {top : 80,left: 80,right: 80,bottom: 80};
}

Z-margin.jpg

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

try marginPreferences property present on document, it has these option. Look at the following

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#MarginPreference.html

 

-Manan

TOPICS
Scripting

Views

307

Likes

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
May 29, 2020 0
Adobe Community Professional ,
May 29, 2020

Copy link to clipboard

Copied

try marginPreferences property present on document, it has these option. Look at the following

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#MarginPreference.html

 

-Manan

Likes

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
Reply
Loading...
May 29, 2020 1
Guru ,
May 29, 2020

Copy link to clipboard

Copied

myDocument.marginPreferences.properties = {top : 80,left: 80,right: 80,bottom: 80};

marginPreferences is member of document object

Likes

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
Reply
Loading...
May 29, 2020 2