Copy link to clipboard
While this property is not directly available, there are some things you can do to find the resolution.
Here are the steps for a script to follow.
1. save the current viewState:
var vsOrig = this.viewState.toSource();
2. Set the zoom type to FitH. Save the zoom level.
3. Set the zoom type to FitV. Save the zoom level.
4. Reset the viewSate.
this.viewState = eval(vsOrig);
Now you have proportionality factors between the current zoom and the full width and height of the document. This gives you enough information to calculate the portion of a document page being shown so you can set the page offsets (scroll) exactly.
Its all worked out, calculations and the code, here (but it's only available to site members):