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

Resize Artboard based on Center Bottom

Explorer ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Hello!

I'd like to start a script to resize my artboard (in my case, just one for document) based on Center-Bottom reference point.

Example: my file originally have 200x100mm and I want to change to 230x140mm without moving any content.

reason: I work with a lot of label that change the page size only depending of which manufacturer. (I will build a database inside the script after).

Any clue will be appreciated.

TOPICS
Scripting

Views

3.3K

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

Explorer , Aug 19, 2017 Aug 19, 2017

Hi

Thanks a lot for the article indication which was very helpful, but I found another article Re: Is it possible to resize all artboards at once the way you used to be able to do in document set-up? by CarlosCanto​ that brought me this:

#target Illustrator 

 

 

//  script.name = resizeArtboards_CS4andUp.jsx; 

//  script.description = resizes all artboards; 

//  script.requirement = one document with at least one artboard; 

//  script.parent = carlos canto // 11/4/12; 

//  script.elegant = false;

...

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Hi,

You can reference below article.

https://forums.adobe.com/message/5770566

However, previouse one based Top-Left position and you have to calculate and set to Bottom-Center.

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
Explorer ,
Aug 19, 2017 Aug 19, 2017

Copy link to clipboard

Copied

Hi

Thanks a lot for the article indication which was very helpful, but I found another article Re: Is it possible to resize all artboards at once the way you used to be able to do in document set... by CarlosCanto​ that brought me this:

#target Illustrator 

 

 

//  script.name = resizeArtboards_CS4andUp.jsx; 

//  script.description = resizes all artboards; 

//  script.requirement = one document with at least one artboard; 

//  script.parent = carlos canto // 11/4/12; 

//  script.elegant = false; 

 

if (app.documents.length > 0) { 

 

 

        //alert("more than 0"); 

                    var idoc = app.activeDocument; 

 

 

        var title = "Resize All Artboards"; 

 

 

        var width = Number(Window.prompt ("Enter New Artboard Width in points", 400, title)); 

        var height = Number(Window.prompt ("Enter New Artboard Height in points", 250, title)); 

 

 

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

        var abBounds = idoc.artboards.artboardRect;// left, top, right, bottom 

 

 

        var ableft = abBounds[0]; // 0 

        var abtop = abBounds[1]; // 612 

        var abwidth = abBounds[2] - ableft; // 792 // width 

        var abheight = abtop- abBounds[3]; // 0 // height 

         

        var abctrx = abwidth/2+ableft; 

        var abctry = abtop-abheight;//edited from original 

              

        var ableft = abctrx-width/2;  

        var abtop = abctry+height;//edited from original 

        var abright = abctrx+width/2;  

        var abbottom = abBounds[3]; //edited from original

         

        idoc.artboards.artboardRect = [ableft, abtop, abright, abbottom]; 

    } 

else  { 

        alert ("there are no open documents"); 

I hope it helps somebody else with the same question.

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
New Here ,
Apr 24, 2018 Apr 24, 2018

Copy link to clipboard

Copied

LATEST

So what if I went to set the artboard to inches instead of point and what If I want it to center from the middle?

Thanks

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