Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How set margins in new dcoument (script)

Contributor ,
May 29, 2020 May 29, 2020

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

TOPICS
Scripting
912
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 29, 2020 May 29, 2020

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

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

 

-Manan

Translate
Community Expert ,
May 29, 2020 May 29, 2020

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

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

 

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
May 29, 2020 May 29, 2020
LATEST

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

marginPreferences is member of document object

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines