Description
Use this method to specify the Zoom to be used during print preview - this is view zooming, not printscaling.
Syntax
printing.SetPreviewZoom(lZoom, pagesX, pagesY)
Parameter |
Description |
lZoom
|
(Number) The Zoom scaling to use, either expressed as a percentage (e.g. 200 for double full size)
or one of the following special values:
Value |
Meaning |
-1 |
Zoom to show the full page width in the view.
|
-2 |
Zoom to show the full page height in the view.
|
-3 |
Zoom to show 2 full height pages in the view.
|
0 |
Zoom to show full height pages, layed out as described by the pagesX and
pagesY parameters (requires the IE 7 style template).
|
For the IE 6 and earlier style template, the default value is 75%. For IE 7 and later style
templates, the default value is -2.
|
pagesX
|
[Optional, requires the IE 7 style template] (Number) Only used with the IE 7 style template when
lZoom is 0. Specifies the number of pages to display across the view (columns).
|
pagesY
|
[Optional, requires the IE 7 style template] (Number) Only used with the IE 7 style template when
lZoom is 0. Specifies the number of rows of pages to display.
|
Example
function startPreview() {
var z, x=0, y=0;
// if not IE 7 template
if (document.getElementById("selectTemplate").selectedIndex != 1) {
var s = document.getElementById("selectZoom");
z = s.options[s.selectedIndex].value;
}
else {
var s = document.getElementById("selectZoom");
var s1 = document.getElementById("selectPages");
var o = parseInt(s1.options[s1.selectedIndex].value);
switch (o) {
case 0: // zoomed one page
z = s.options[s.selectedIndex].value;
break;
case 2: // the rest are multi-page views.
z = 0;
x = 2;
y = 1;
break;
case 3:
z = 0;
x = 3;
y = 1;
break;
case 6:
z = 0;
x = 3;
y = 2;
break;
case 12:
z = 0;
x = 4;
y = 3;
break;
}
}
factory.printing.SetPreviewZoom(z, x, y);
factory.printing.Preview();
}