Page 1 of 1

Zoom in viewer

Posted: Sat Nov 26, 2016 4:45 pm
by jpgb
Can i change the viewer toolbar zoom after displaying the report in the viewer?

JB

Re: Zoom in viewer

Posted: Mon Nov 28, 2016 11:48 am
by Alex K.
Hello,

You can use following actions:
viewer.jsObject.postAction(action);
action is a string value:
"FirstPage"
"PrevPage"
"NextPage"
"LastPage"
"FullScreen"
"Zoom25"
"Zoom50"
"Zoom75"
"Zoom100"
"Zoom150"
"Zoom200"
"ZoomOnePage"
"ZoomPageWidth"
"About"
"Design"

Thank you.

Re: Zoom in viewer

Posted: Mon Nov 28, 2016 5:48 pm
by jpgb
Thanks Aleksey, but the problem still continues.

Basically, i want the report to adjust to the viewer area to see the whole report

this should work (i think) - viewer.jsObject.postAction("ZoomPageWidth");

When the report orientation is 0, it works fine, but with reports with orientation 1, you will not see part of the map.

I had to do something like this:

if (report.pages.getByIndex(0).orientation==0)
viewer.jsObject.postAction("ZoomPageWidth");
else
viewer.jsObject.postAction("Zoom75");

Re: Zoom in viewer

Posted: Tue Nov 29, 2016 8:39 am
by Alex K.
Hello,

Please try to use the "ZoomOnePage" for the landscape page orientation.
Or try to use the following code:

Code: Select all

var options = new Stimulsoft.Viewer.StiViewerOptions();
//options.toolbar.zoom = -1; // zoom by width (orientation 0)
options.toolbar.zoom = -2; // zoom by height (orientation 1)
Thank you.