Skip to main content
Inspiring
July 13, 2022
Answered

How to set ruler 0 point to canvas?

  • July 13, 2022
  • 1 reply
  • 1465 views

 

Hi,

Using Javascript, how to set the ruler origin to top left canvas corner point?

 

 

What is the official name for the area outside an artboard? Is it canvas, workspace, workarea, pastboard, ...?

Where is located it in the DOM? 

 

Thank you.

 

This topic has been closed for replies.
Correct answer femkeblanco

I don't know if it's official (it's not in my Using Adobe Illustrator guide), but I've seen it called pasteboard.  As it happens, I believe @CarlosCanto answered the same question yesterday.  See here.

1 reply

femkeblanco
femkeblancoCorrect answer
Legend
July 13, 2022

I don't know if it's official (it's not in my Using Adobe Illustrator guide), but I've seen it called pasteboard.  As it happens, I believe @CarlosCanto answered the same question yesterday.  See here.

tmmlsAuthor
Inspiring
July 13, 2022

Thank you for sharing this info. This was very usefull. 

 

I did some small adjustments. Below my working code...

 

 

 

var myDoc = app.activeDocument;

var dim = getLargestBounds(); 

myDoc.rulerOrigin = [dim[0],dim[1]+myDoc.height];


function getLargestBounds() {  
    var tempLayer, tempText, left, top, LARGEST_SIZE = 16383;  

    tempLayer = app.activeDocument.layers.add();  
    tempText = tempLayer.textFrames.add();  

    left = tempText.matrix.mValueTX;  
    top = tempText.matrix.mValueTY;  

    tempLayer.remove();  

    var dimensions = [left, top, left + LARGEST_SIZE, top + LARGEST_SIZE ];

    return dimensions;
}  

 

 



renél80416020
Inspiring
July 14, 2022

Bonjour,

myDoc.rulerOrigin = [dim[0],dim[1]+myDoc.height];

Cette ligne donne un bon résultat uniquement si le plan de travail 0 (artBoard) est dans sa position initiale.

Essayer de le déplacer et relancez le script, vous constaterez que la position de l'origine n'est pas à l'endroit souhaité.

Dans quel but voulez vous placer l'origine des règles à cet endroit ?

René