Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / PrintInfo Class / ZoomFactor Property
Example


In This Topic
    ZoomFactor Property (PrintInfo)
    In This Topic
    Gets or sets the zoom factor used for printing this sheet.
    Syntax
    'Declaration
     
    Public Property ZoomFactor As Single
    'Usage
     
    Dim instance As PrintInfo
    Dim value As Single
     
    instance.ZoomFactor = value
     
    value = instance.ZoomFactor
    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 optimizing 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.
    // 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
    printset.PrintToPdf = true;
    printset.PdfFileName = "C:\\results.pdf";
    fpSpread1.Sheets[0].PrintInfo = printset;
    fpSpread1.PrintSheet(0);
    ' 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
    printset.PrintToPdf = True
    printset.PdfFileName = "C:\results.pdf"
    FpSpread1.Sheets(0).PrintInfo = printset
    FpSpread1.PrintSheet(0)
    See Also