Skip to main content
jctremblay
Community Expert
Community Expert
November 28, 2019
Question

Create first artboard on top left of canvas. How?

  • November 28, 2019
  • 2 replies
  • 1415 views

When creating an illustrator document with a single artboard, the artboard is centered in the 227x227in big canvas. I would like to have the single artboard place top/left instead. Is there a way to achieve this on creating a document.

My workaround is to create a document with a 227 x 227 size artboard than reduze the size of it. 

This topic has been closed for replies.

2 replies

CarlosCanto
Community Expert
Community Expert
December 1, 2019

Here's a script to move your first artboard to top/left corner of pasteboard. You need to create your document as usual, then run the script to move the artboard. I could write a script to create the document with the artboard already moved, but there are too many options to set up a document that will take me a lot more effort to script.

 

thanks to OMOTI for creating a function to get top/left coordinates

 

// move artboard 0 to far Left/Top Corner of Pasteboard
// OMOTI / carlos canto 12/1/2019
// https://community.adobe.com/t5/illustrator/create-first-artboard-on-top-left-of-canvas-how/td-p/10767994

function main() {
    var idoc = app.activeDocument;
    

    var rect = getLargestBounds();  
    
    // repositon first artboard
    idoc.artboards[0].artboardRect = [rect[0], rect[1], rect[0]+idoc.width, rect[1]-idoc.height];
}

main();

function moveArtboardToLeftTopCorner() {
    
}

// get max paste board bounds
// OMOTI
// https://forums.adobe.com/thread/2459293

function getLargestBounds() {  
    var tempLayer,  
        tempText,  
        left,  
        top,  
        LARGEST_SIZE = 16383;  
    if (!app.documents.length) {  
        return;  
    }  
    tempLayer = app.activeDocument.layers.add();  
    tempText = tempLayer.textFrames.add();  
    left = tempText.matrix.mValueTX;  
    top = tempText.matrix.mValueTY;  
    tempLayer.remove();  
    return new Rect(  
        left,  
        top,  
        left + LARGEST_SIZE,  
        top + LARGEST_SIZE  
    );  
}  
   

 

 

tromboniator
Community Expert
Community Expert
November 28, 2019

I don't know if this answers your need, Jean-Claude, but I created a document with a top-left artboard and saved it as a template. Illustrator did not let me save it in the Templates folder

but I was able to save it elsewhere and move it there.

 

Peter

jctremblay
Community Expert
Community Expert
November 28, 2019

That’s another workaround... thanks!