Get true artboard size with "large canvas" document from ExtendScript

Community Beginner ,
Jun 17, 2020 Jun 17, 2020

Copy link to clipboard

Copied

The latest release of Illustrator adds a new "large canvas" document  for any artboard created that is larger than 227 inches in width and/or height. What it appears to be doing behind the scenes is actually changing the document scale to 1/10 of the original size.

 

I have an ExtendScript extension that gets the document dimensions via app.activeDocument.width. With the new "large canvas" document, the dimensions returned are 1/10 their actual value. 

 

For example, if I create an artboard that  is 400 inches wide by 300 inches tall (so lustrator uses a "large canvas"), when I check the size of the artboard using app.activeDocument.width it returns 40 instead of 400.

 

Is there a way to either detect when a "large canvas" is being used, or to get the true dimensions of the artboard? 

TOPICS
Bug, Scripting

Views

491

Likes

translate

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

Engaged , Jun 17, 2020 Jun 17, 2020
Hi Adam, There is a property of document called scaleFactor. On a large document it is 10, otherwise it's 1.app.activeDocument.scaleFactor Regards,Mark 

Likes

translate

Translate

Translate
Engaged ,
Jun 17, 2020 Jun 17, 2020

Copy link to clipboard

Copied

Hi Adam,

 

There is a property of document called scaleFactor. On a large document it is 10, otherwise it's 1.

app.activeDocument.scaleFactor

 

Regards,

Mark 

Likes

translate

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
Community Beginner ,
Jun 17, 2020 Jun 17, 2020

Copy link to clipboard

Copied

Mark, you're my hero. I couldn't find this documented anywhere! Thanks!

Likes

translate

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
Engaged ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

By the way, I found it by running the Extendscript Debugger in Visual Studio Code and looking at the active document object while the debugger was running. You can see the properties and their values.

 

Mark

Likes

translate

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
Enthusiast ,
Sep 16, 2020 Sep 16, 2020

Copy link to clipboard

Copied

Hi Mark.  Could you possibly provide more details on how you did this with the Extendscript Debugger  and Visual Studio Code?  Thanks in advance. 

Likes

translate

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
Engaged ,
Sep 16, 2020 Sep 16, 2020

Copy link to clipboard

Copied

Hi femkeblanco,

 

In Visual Studio Code I made a script which invoked the debugger:

 

debugger;

 

 

Then ran the script using the ExtendScript Debugger. By the way, this was my launch configuration:

 

{
"type": "extendscript-debug",
"request": "launch",
"name": "Debug current file",
"program": "${file}",
"targetSpecifier": "illustrator-24.064"
}

 

 

As the script runs, Illustrator is activated but, when the debugger is invoked, Visual Studio Code is re-activated and the script is paused. This is where you would be stepping through the debugging process, but that isn't what I needed this time.


I looked in the debug pane under 'variables' and navigated to 'local/app/activeDocument', and then I looked through the list of properties of the active document and found 'scaleFactor'. Bingo!

 

Hope that works for you.

 

- Mark

Likes

translate

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
Enthusiast ,
Sep 17, 2020 Sep 17, 2020

Copy link to clipboard

Copied

Thanks a lot.  I'll try this today.  

Likes

translate

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