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

How set margins in new dcoument (script)

Participant ,
May 29, 2020 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

TOPICS
Scripting

Views

662

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
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

Votes

Translate

Translate
Community Expert ,
May 29, 2020 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

Votes

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
community guidelines
Guru ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

LATEST

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

marginPreferences is member of document object

Votes

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
community guidelines