Skip to main content
zsaaro
Inspiring
October 13, 2025
Question

view.zoom changes based on display DPI

  • October 13, 2025
  • 1 reply
  • 75 views

I noticed

app.activeViewer.views[0].options.zoom;

 gives a different result on my mac vs my PC. 

On my mac when the view is at 100% zoom I get 0.5, while on my PC I get 1.

I assume it has something to do with display scaling, but I couldn't find any information about this online. The docs should emphasize this.

 

What's the best way to reliably get the correct value through extendscript?

 

Also, since I am creating a CEP panel, could I just multiply the value by

window.devicePixelRatio

or do I need to take other factors into account?

 

Thank you.

1 reply

zsaaro
zsaaroAuthor
Inspiring
October 13, 2025

Update:

On windows it seems like:

app.activeViewer.views[0].options.zoom

returns the correct number no matter my display settings, so multiplying the value by:

window.devicePixelRatio

seems to only be needed on MacOS.