ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Win Assembly / GrapeCity.ActiveReports.Viewer.Win Namespace / Viewer Class / Zoom Property
Example

In This Topic
    Zoom Property (Viewer)
    In This Topic
    Gets or sets the viewer's zoom level. 1 for FitWidth mode 2 for Fit Whole Page mode. Throws ArgumentOutOfRangeException on invalid value.
    Syntax
    'Declaration
     
    Public Property Zoom As Single
    public float Zoom {get; set;}

    Property Value

    The zoom level of the viewer, where:
    • -1 indicates Fit Width mode,
    • -2 indicates Fit Whole Page mode,
    • A positive value indicates a specific zoom level (e.g., 1.0 for 100%).
    Exceptions
    ExceptionDescription
    Thrown when the value is less than -2 or equal to 0.
    Thrown when attempting to set the zoom level while in a mode where zoom is not enabled.
    Remarks
    The default value is 1f, which corresponds to 100% zoom.

    Setting the zoom level to -1 or -2 adjusts the view to fit the width or the entire page within the viewer's display area, respectively. Specifying a positive value sets the zoom to that specific level.

    Example
    // Assuming 'viewer' is an instance of the Viewer class
    viewer.Zoom = 1f; // 100% zoom
    viewer.Zoom = -2; // Fit Whole Page
    viewer.Zoom = 1.5f; // 150% zoom
    See Also