Sair
  • Comunidade global
    • Idioma:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Resize Artboard based on Center Bottom

Explorador ,
Aug 16, 2017 Aug 16, 2017

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.

TÓPICOS
Scripts
3.7K
Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines

correct answers 1 resposta correta

Explorador , 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;

...
Traduzir
Adobe
Community Expert ,
Aug 16, 2017 Aug 16, 2017

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.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
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... 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.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Novato ,
Apr 24, 2018 Apr 24, 2018
MAIS RECENTE

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

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines