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

Small page size in Indesign CS6 js

Participant ,
May 28, 2019 May 28, 2019

Hi,

I am unable to resize page document size in Indesign CS6 js smaller than 1 inch. I set the Margin to 0, but unable to set Gutter to 0. Maybe that is the reason:

masters = myDoc.masterSpreads.item('A-Master').pages; 

for (i = 0; i < masters.length; i++) { 

    masters.marginPreferences.properties = { 

top: 0,

left: 0,

right: 0,

bottom: 0

}}

myPageCount = "1";

myPageCount = eval (myPageCount);

with(myDoc.documentPreferences){

pagesPerDocument = 2;

}

myDoc.spreads[0].remove();

with(myDoc.documentPreferences){

pagesPerDocument = myPageCount;

}

while ( pg = pgs.pop() ) {

       

app.marginPreferences.properties = { 

     top:0, left:0, bottom:0, right:0, 

     columnGutter:0, columnCount:1

};

}

Thank you

Yulia

TOPICS
Scripting
901
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
Advocate ,
May 28, 2019 May 28, 2019

Hi Yuliascript,

    Try this:

app.documents[0].viewPreferences.horizontalMeasurementUnits = MeasurementUnits.INCHES;

app.documents[0].viewPreferences.verticalMeasurementUnits = MeasurementUnits.INCHES;

app.documents[0].documentPreferences.pageWidth = app.documents[0].documentPreferences.pageWidth - 1;

app.documents[0].documentPreferences.pageHeight = app.documents[0].documentPreferences.pageHeight - 1;

app.documents[0].pages[0].marginPreferences.columnGutter = 0;

app.documents[0].pages[0].marginPreferences.left = 0;

app.documents[0].pages[0].marginPreferences.right = 0;

app.documents[0].pages[0].marginPreferences.top = 0;

app.documents[0].pages[0].marginPreferences.bottom = 0;

Best

Sunil

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

Thank you, Sunil.

It looks now that there is more to the story, because with your code I get 0 Margin and 0 Gutter, but small sizes still fail to resize.

I have few sizes in the script set up in the same way, when one is bigger than I inch by 1 inch it works, but when when one is smaller it fails at resizing line.

If this helps, here is my code:

myWidth = 0.625;   //  art size

myHeight = .25;

with(myDoc.documentPreferences){

    pageHeight = myHeight;

    pageWidth = myWidth;

    }

Thank you

Yulia

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
Enthusiast ,
May 30, 2019 May 30, 2019

Perhaps by setting the margin preferences for the application before creating the document can do it for you. This works in InDesign CC 2019. (Notice that application preferences are saved and later restored.)

app.scriptPreferences.measurementUnit = MeasurementUnits.INCHES;

var oldPrefs = app.marginPreferences.properties;

app.marginPreferences.properties = {left:0, right:0, top:0, bottom:0};

var docRef = app.documents.add();

docRef.documentPreferences.pageWidth = .65;

docRef.documentPreferences.pageHeight = .25;

app.marginPreferences.properties = oldPrefs;

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
Community Expert ,
May 30, 2019 May 30, 2019
LATEST

https://forums.adobe.com/people/S+Hopkins  wrote

Perhaps by setting the margin preferences for the application before creating the document can do it for you. …

Absolutely!

That's the key here.

Regards,
Uwe

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