Spread Windows Forms 6.0 Product Documentation
ZoomFactor Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > PrintInfo Class : ZoomFactor Property


Glossary Item Box

Gets or sets the zoom factor used for printing this sheet.

Syntax

Visual Basic (Declaration) 
Public Property ZoomFactor As Single
Visual Basic (Usage)Copy Code
Dim instance As PrintInfo
Dim value As Single
 
instance.ZoomFactor = value
 
value = instance.ZoomFactor
C# 
public float ZoomFactor {get; set;}

Property Value

Single-precision, floating-point number representing the amount of scaling for printing

Remarks

Set this property to any value between 0.1F (or 10%) and 4.0F (or 400%) to specify the percent at which to print the sheet. Values outside of that range result in an out-of-range exception. For example, to print the object at half its normal size or 50% zoom, set the property to 0.5; to print at twice its normal size or 200%, set the property to 2.

You can also let Spread determine the optimum scaling, by using the ScaleRule object, one of the SmartPrint rules used for optimzing the printing.

This zoom factor and the zoom within the print preview are different. This property affects the size of the actual display and print out. The zoom within the print preview dialog is simply a temporary display effect.

Example

This example shows how to define the settings for customizing the printed page layout.
C#Copy Code
// Define the printer settings
FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
FarPoint.Win.Spread.PrintMargin printmar = new FarPoint.Win.Spread.PrintMargin();

printmar.Left = 10;
printmar.Right = 10;
printmar.Top = 20;
printmar.Bottom = 40;

printset.Centering = FarPoint.Win.Spread.Centering.Both;
printset.FirstPageNumber = 1;
printset.Margin = printmar;
printset.Opacity = 60;
printset.Orientation = FarPoint.Win.Spread.PrintOrientation.Portrait;
printset.ShowBorder = false;
printset.ShowColor = false;
printset.ShowColumnHeader = FarPoint.Win.Spread.PrintHeader.Hide;
printset.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide;
printset.ShowGrid = true;
printset.ShowShadows = false;
printset.ZoomFactor = 2;

// Assign the printer settings to the sheet and print it
fpSpread1.Sheets[0].PrintInfo = printset;
fpSpread1.PrintSheet(0);
Visual BasicCopy Code
' Define the printer settings
Dim printset As New FarPoint.Win.Spread.PrintInfo()
Dim printmar As New FarPoint.Win.Spread.PrintMargin

printmar.Left = 10
printmar.Right = 10
printmar.Top = 20
printmar.Bottom = 40

printset.Centering = FarPoint.Win.Spread.Centering.Both
printset.FirstPageNumber = 1
printset.Margin = printmar
printset.Opacity = 60
printset.Orientation = FarPoint.Win.Spread.PrintOrientation.Portrait
printset.ShowBorder = False
printset.ShowColor = False
printset.ShowColumnHeader = FarPoint.Win.Spread.PrintHeader.Hide
printset.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide
printset.ShowGrid = True
printset.ShowShadows = False
printset.ZoomFactor = 2

' Assign the printer settings to the sheet and print it
FpSpread1.Sheets(0).PrintInfo = printset
FpSpread1.PrintSheet(0)

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.