Summary: Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# PDFDocViewPrefs

extends Object

java.lang.Object
↳ | com.pdftron.pdf.PDFDocViewPrefs

## Class Overview

PDFDocViewPrefs is a high-level utility class that can be used to control the way the document is to be presented on the screen or in print. PDFDocViewPrefs class corresponds to PageMode, PageLayout, and ViewerPreferences entries in the document's catalog. For more details please refer to section 8.1 'Viewer Preferences' in PDF Reference Manual.

## Summary

Constants
int | e_CenterWindow | The Constant e_CenterWindow.
int | e_Default | PageLayout specifies the page layout to be used when the document is opened: - e_SinglePage Display one page at a time - e_OneColumn Display the pages in one-column mode.
int | e_DisplayDocTitle | The Constant e_DisplayDocTitle.
int | e_FitWindow | The Constant e_FitWindow.
int | e_FullScreen | The Constant e_FullScreen.
int | e_HideMenubar | The Constant e_HideMenubar.
int | e_HideToolbar | ViewerPref enumeration specifies how various GUI elements should behave when the document is opened.
int | e_HideWindowUI | The Constant e_HideWindowUI.
int | e_OneColumn | The Constant e_OneColumn.
int | e_SinglePage | The Constant e_SinglePage.
int | e_TwoColumnLeft | The Constant e_TwoColumnLeft.
int | e_TwoColumnRight | The Constant e_TwoColumnRight.
int | e_TwoPageLeft | The Constant e_TwoPageLeft.
int | e_TwoPageRight | The Constant e_TwoPageRight.
int | e_UseAttachments | The Constant e_UseAttachments.
int | e_UseBookmarks | The Constant e_UseBookmarks.
int | e_UseNone | PageMode specifies how the document should be displayed when opened: - e_UseNone Displays document, but neither thumbnails nor bookmarks.
int | e_UseOC | The Constant e_UseOC.
int | e_UseThumbs | The Constant e_UseThumbs.

Public Constructors
| PDFDocViewPrefs(Obj tr) PDFDocViewPrefs constructor.

Public Methods
boolean | getDirection() Get the direction.
int | getLayoutMode() Get the layout mode.
int | getNonFullScreenPageMode() Get the non full screen page mode.
int | getPageMode() Get the page mode.
boolean | getPref(int pref) Get the value of given ViewerPref property.
int | getPrintArea() Get the prints the area.
int | getPrintClip() Get the prints the clip.
Obj | getSDFObj() Get the underlying SDFObj.
int | getViewArea() Get the view area.
int | getViewClip() Get the view clip.
void | setDirection(boolean left_to_right) Set the predominant reading order for text.
void | setInitialPage(Destination dest) A utility method used to set the fist page displayed after the document is opened.
void | setLayoutMode(int layout) Set PageLayout property and change the value of the PageLayout key in the Catalog dictionary.
void | setNonFullScreenPageMode(int mode) Set the document's page mode, specifying how to display the document on exiting full-screen mode.
void | setPageMode(int mode) Set PageMode property and change the value of the PageMode key in the Catalog dictionary.
void | setPref(int pref, boolean value) Set the value of given ViewerPref property.
void | setPrintArea(int box) Set the page boundary representing the area of a page to be rendered when printing the document.
void | setPrintClip(int box) Set the page boundary to which the contents of a page are to be clipped when printing the document.
void | setViewArea(int box) Set the page boundary representing the area of a page to be displayed when viewing the document on the screen.
void | setViewClip(int box) Set the page boundary to which the contents of a page are to be clipped when viewing the document on the screen.

[Expand] Inherited Methods
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Constants

#### public static final int e_CenterWindow

The Constant e_CenterWindow.

Constant Value: 4 (0x00000004)

#### public static final int e_Default

PageLayout specifies the page layout to be used when the document is opened: - e_SinglePage Display one page at a time - e_OneColumn Display the pages in one-column mode. - e_TwoColumnLeft Display the pages in two-column continuous mode with first page on left (i.e. all odd numbered pages on the left). - e_TwoColumnRight Display the pages in two-column continuous mode with first page on right (i.e. all odd numbered pages on the right). - e_TwoPageLeft Display the pages two at a time, with odd-numbered pages on the left. - e_TwoPageRight Display the pages two at a time, with odd-numbered pages on the right.

Constant Value: 0 (0x00000000)

#### public static final int e_DisplayDocTitle

The Constant e_DisplayDocTitle.

Constant Value: 5 (0x00000005)

#### public static final int e_FitWindow

The Constant e_FitWindow.

Constant Value: 3 (0x00000003)

#### public static final int e_FullScreen

The Constant e_FullScreen.

Constant Value: 3 (0x00000003)

#### public static final int e_HideMenubar

The Constant e_HideMenubar.

Constant Value: 1 (0x00000001)

#### public static final int e_HideToolbar

ViewerPref enumeration specifies how various GUI elements should behave when the document is opened. - e_HideToolbar A flag specifying whether to hide the viewer application's toolbars when the document is active. Default value: false. - e_HideMenubar A flag specifying whether to hide the viewer application's menu bar when the document is active. Default value: false. - e_HideWindowUI A flag specifying whether to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed. Default value: false. - e_FitWindow A flag specifying whether to resize the document's window to fit the size of the first displayed page. Default value: false. - e_CenterWindow A flag specifying whether to position the document's window in the center of the screen. Default value: false. - e_DisplayDocTitle A flag specifying whether the window's title bar should display the document title taken from the Title entry of the document information dictionary. If false, the title bar should instead display the name of the PDF file containing the document. Default value: false.

Constant Value: 0 (0x00000000)

#### public static final int e_HideWindowUI

The Constant e_HideWindowUI.

Constant Value: 2 (0x00000002)

#### public static final int e_OneColumn

The Constant e_OneColumn.

Constant Value: 2 (0x00000002)

#### public static final int e_SinglePage

The Constant e_SinglePage.

Constant Value: 1 (0x00000001)

#### public static final int e_TwoColumnLeft

The Constant e_TwoColumnLeft.

Constant Value: 3 (0x00000003)

#### public static final int e_TwoColumnRight

The Constant e_TwoColumnRight.

Constant Value: 4 (0x00000004)

#### public static final int e_TwoPageLeft

The Constant e_TwoPageLeft.

Constant Value: 5 (0x00000005)

#### public static final int e_TwoPageRight

The Constant e_TwoPageRight.

Constant Value: 6 (0x00000006)

#### public static final int e_UseAttachments

The Constant e_UseAttachments.

Constant Value: 5 (0x00000005)

#### public static final int e_UseBookmarks

The Constant e_UseBookmarks.

Constant Value: 2 (0x00000002)

#### public static final int e_UseNone

PageMode specifies how the document should be displayed when opened: - e_UseNone Displays document, but neither thumbnails nor bookmarks. - e_UseThumbs Displays document plus thumbnails. - e_UseBookmarks Displays document plus bookmarks. - e_FullScreen Displays document in full-screen viewing mode. - e_UseOC Displays Optional Content (OC) group panel. - e_UseAttachments - Displays attachments panel.

Constant Value: 0 (0x00000000)

#### public static final int e_UseOC

The Constant e_UseOC.

Constant Value: 4 (0x00000004)

#### public static final int e_UseThumbs

The Constant e_UseThumbs.

Constant Value: 1 (0x00000001)

## Public Constructors

#### public PDFDocViewPrefs (Obj tr)

PDFDocViewPrefs constructor. Typically this constructor is never used since it is easier to obtain PDFDocViewPrefs using PDFDoc.GetViewPrefs()

## Public Methods

#### public boolean getDirection ()

Get the direction.

##### Returns

- true is the predominant reading order for text is left to right, false otherwise. See SetDirection() for more information.

##### Throws

PDFNetException |

#### public int getLayoutMode ()

Get the layout mode.

##### Returns

- The value of currently selected PageLayout property.

##### Throws

PDFNetException |

#### public int getNonFullScreenPageMode ()

Get the non full screen page mode.

Note: This entry is meaningful only if the value of the PageMode is set to e_FullScreen; it is ignored otherwise.

##### Returns

- the PageMode used after exiting full-screen mode.

##### Throws

PDFNetException |

#### public int getPageMode ()

Get the page mode.

##### Returns

- The value of currently selected PageMode property.

##### Throws

PDFNetException |

#### public boolean getPref (int pref)

Get the value of given ViewerPref property.

##### Parameters

pref | the ViewerPref property type to query.

##### Returns

- the value of given ViewerPref property.

##### Throws

PDFNetException |

#### public int getPrintArea ()

Get the prints the area.

##### Returns

- the page boundary representing the area of a page to be rendered when printing the document.

##### Throws

PDFNetException |

#### public int getPrintClip ()

Get the prints the clip.

##### Returns

- the page boundary to which the contents of a page are to be clipped when printing the document.

##### Throws

PDFNetException |

#### public Obj getSDFObj ()

Get the underlying SDFObj.

##### Returns

- document's SDF/Cos 'ViewerPreferences' dictionary or NULL if the object is not present.

#### public int getViewArea ()

Get the view area.

##### Returns

- the page boundary representing the area of a page to be displayed when viewing the document on the screen.

##### Throws

PDFNetException |

#### public int getViewClip ()

Get the view clip.

##### Returns

- the page boundary to which the contents of a page are to be clipped when viewing the document on the screen.

##### Throws

PDFNetException |

#### public void setDirection (boolean left_to_right)

Set the predominant reading order for text. This flag has no direct effect on the document's contents or page numbering but can be used to determine the relative positioning of pages when displayed side by side or printed n-up.

##### Parameters

left_to_right | - true if the predominant reading order for text is from left to right and false if it is right to left (including vertical writing systems, such as Chinese, Japanese, and Korean). Default value: left_to_right is true.

##### Throws

PDFNetException |

#### public void setInitialPage (Destination dest)

A utility method used to set the fist page displayed after the document is opened. This method is equivalent to PDFDoc::SetOpenAction(goto_action). If OpenAction is not specified the document should be opened to the top of the first page at the default magnification factor.

##### Parameters

dest | A value specifying the page destination to be displayed when the document is opened.

##### Throws

PDFNetException | `Destination dest = Destination::CreateFit(page); pdfdoc.GetViewPrefs().SetInitialPage(dest);`

#### public void setLayoutMode (int layout)

Set PageLayout property and change the value of the PageLayout key in the Catalog dictionary.

##### Parameters

layout | the new layout mode

##### Throws

PDFNetException |

#### public void setNonFullScreenPageMode (int mode)

Set the document's page mode, specifying how to display the document on exiting full-screen mode.

Note: This entry is meaningful only if the value of the PageMode is set to e_FullScreen; it is ignored otherwise.

##### Parameters

mode | PageMode used after exiting full-screen mode. Default value: e_UseNone.

##### Throws

PDFNetException |

#### public void setPageMode (int mode)

Set PageMode property and change the value of the PageMode key in the Catalog dictionary.

##### Parameters

mode | New PageMode setting. Default value is e_UseNone.

##### Throws

PDFNetException |

#### public void setPref (int pref, boolean value)

Set the value of given ViewerPref property.

##### Parameters

pref | the ViewerPref property type to modifiy.
value | The new value for the property.

##### Throws

PDFNetException |

#### public void setPrintArea (int box)

Set the page boundary representing the area of a page to be rendered when printing the document.

##### Parameters

box | printing region. The default value is page crop-box.

##### Throws

PDFNetException |

#### public void setPrintClip (int box)

Set the page boundary to which the contents of a page are to be clipped when printing the document.

##### Parameters

box | printing clip region. The default value is page crop-box.

##### Throws

PDFNetException |

#### public void setViewArea (int box)

Set the page boundary representing the area of a page to be displayed when viewing the document on the screen.

##### Parameters

box | page boundary displayed when viewing the document on the screen. By defualt, PDF viewers will display the crop-box.

##### Throws

PDFNetException |

#### public void setViewClip (int box)

Set the page boundary to which the contents of a page are to be clipped when viewing the document on the screen.

##### Parameters

box | screen clip region. The default value is page crop-box.

##### Throws

PDFNetException |