Zoom Class

Magnification Setting.When the object is serialized out as xml, its qualified name is w:zoom.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.Zoom

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Class Zoom _
    Inherits OpenXmlLeafElement
'Usage
Dim instance As Zoom
public class Zoom : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 1st Edition]

17.15.1.94 zoom (Magnification Setting)

This element specifies the magnification level which should be applied to a document when it is displayed by an application. The zoom level is specified with the use of two attributes stored on this element:

  • val, which stores the type of zoom applied to the document

  • percent, which stores the zoom percentage to be used when rendering the document

If both attributes are present, then the percent attribute shall be treated as a 'cached' value and only used when the value none is specified for the val attribute.

If this element is omitted, then applications can display the document in any desired magnification setting.

[Example: Consider a WordprocessingML document that is to have its zoom level at seventy one percent when it is displayed. This requirement would be specified using the following WordprocessingML fragment in the document settings:

<w:zoom w:percent="71%" /> 

The zoom element's percent attribute has a value of 71%, specifying that the given document must have its zoom level set to seventy one percent when it is displayed. end example]

Parent Elements

settings (§17.15.1.78)

Attributes

Description

percent (Zoom Percentage)

Specifies the zoom percentage that should be applied when a given WordprocessingML document is rendered by conforming hosting applications. This value is the zoom percentage specified as an integer with a trailing percent sign (U+0025).

If this attribute is omitted, then applications can use any desired default percentage for the magnification.

If the val attribute instantiated in addition to the percent attribute, then the percent attribute shall be treated as a cached value and only used when the value none is specified for the val attribute. If the value specified exceeds the maximum zoom level available in a conforming hosting application, the conforming hosting application shall display the document using its maximum zoom level. Correspondingly, if the value specified is less than the minimum zoom level available in the conforming hosting application, the conforming hosting application shall display the document using its minimum zoom level.

[Example: Consider a WordprocessingML document that is to have its zoom level at fifty percent when rendered by conforming hosting applications. This requirement would be specified using the following WordprocessingML:

<w:zoom w:percent="50%" /> 

The percent attribute has a value of 50%, specifying that the given WordprocessingML document must to have its zoom level set to fifty percent when it is displayed. end example]

The possible values for this attribute are defined by the ST_DecimalNumberOrPercent simple type (§17.18.11).

val (Zoom Type)

Specifies the type of zoom which shall be applied to a given document on open.

If this attribute is not present, then the document shall be displayed as though the value had been set to none, and should rely on the value of the percent attribute for the actual zoom percentage.

[Example: Consider a WordprocessingML document that should be visible without any horizontal scrolling when it is displayed. This requirement would be specified using the following WordprocessingML:

<w:zoom w:val="bestFit" w:percent="90%" />

The val attribute is equal to the value bestFit specifying that an application must dynamically calculate the magnification needed such that the given document must be visible on the horizontal plane of the document with no horizontal scrolling required to see any part of the WordprocessingML document's pages.

Since both attributes are present, the percent attribute must be treated as a 'cached' value and ignored. end example]

The possible values for this attribute are defined by the ST_Zoom simple type (§17.18.105).

[Note: The W3C XML Schema definition of this element’s content model (CT_Zoom) is located in §A.1. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Zoom Members

DocumentFormat.OpenXml.Wordprocessing Namespace