ViewType

Inheritance: java.lang.Object

public class ViewType

Possible values for the view mode in Microsoft Word.

Examples:

Shows how to set a custom zoom factor, which older versions of Microsoft Word will apply to a document upon loading.


 Document doc = new Document();
 DocumentBuilder builder = new DocumentBuilder(doc);
 builder.writeln("Hello world!");

 doc.getViewOptions().setViewType(ViewType.PAGE_LAYOUT);
 doc.getViewOptions().setZoomPercent(50);

 Assert.assertEquals(ZoomType.CUSTOM, doc.getViewOptions().getZoomType());
 Assert.assertEquals(ZoomType.NONE, doc.getViewOptions().getZoomType());

 doc.save(getArtifactsDir() + "ViewOptions.SetZoomPercentage.doc");
 

Fields

FieldDescription
NONEThe document shall be rendered in the default view of the application.
NORMALThe document shall be rendered in a view optimized for outlining or creating long documents.
OUTLINEThe document shall be rendered in a view optimized for outlining or creating long documents.
PAGE_LAYOUTThe document shall be opened in a view that displays the document as it will print.
READINGThe document shall be rendered in the default view of the application.
WEBThe document shall be rendered in a view mimicking the way this document would be displayed in a web page.
length

Methods

MethodDescription
fromName(String viewTypeName)
getName(int viewType)
getValues()
toString(int viewType)

NONE

public static int NONE

The document shall be rendered in the default view of the application.

NORMAL

public static int NORMAL

The document shall be rendered in a view optimized for outlining or creating long documents.

OUTLINE

public static int OUTLINE

The document shall be rendered in a view optimized for outlining or creating long documents.

PAGE_LAYOUT

public static int PAGE_LAYOUT

The document shall be opened in a view that displays the document as it will print.

READING

public static int READING

The document shall be rendered in the default view of the application.

WEB

public static int WEB

The document shall be rendered in a view mimicking the way this document would be displayed in a web page.

length

public static int length

fromName(String viewTypeName)

public static int fromName(String viewTypeName)

Parameters:

ParameterTypeDescription
viewTypeNamejava.lang.String

Returns: int

getName(int viewType)

public static String getName(int viewType)

Parameters:

ParameterTypeDescription
viewTypeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int viewType)

public static String toString(int viewType)

Parameters:

ParameterTypeDescription
viewTypeint

Returns: java.lang.String