[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.Viewer.Win.Viewer.Zoom

Zoom Property

Zoom

Gets or sets the viewer's zoom level.

Declaration
public float Zoom { get; set; }
Property Value
Type Description
float

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%).
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.

Examples
// 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
Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the value is less than -2 or equal to 0.

InvalidOperationException

Thrown when attempting to set the zoom level while in a mode where zoom is not enabled.