Click or drag to resize
Pdf Library for .NET

Pdf Viewer Preferences

A pdf document can control the way it will be displayed when opened in a pdf viewer. These properties can be set by Select.Pdf library using ViewerPreferences property of the PdfDocument object.

The following customizations can be done using the PdfViewerPreferences object:

Property

Description

HideToolbar

A flag specifying whether to hide the pdf viewer application's tool bars when the document is active

HideMenuBar

A flag specifying whether to hide the pdf viewer application's menu bar when the document is active.

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.

FitWindow

A flag specifying whether to resize the document's window to fit the size of the first displayed page.

CenterWindow

A flag specifying whether to position the document's window in the center of the screen.

DisplayDocTitle

A flag specifying whether the window's title bar should display the document title.

PageMode

The document page mode when the pdf document is opened in a pdf viewer. Possible values:

UseNone

Neither document outline (bookmarks) nor thumbnail images are visible.

UseOutlines

Document outline (bookmarks) are visible.

UseThumbs

Thumbnail images are visible.

FullScreen

Full-screen mode, with no menu bar, window controls or any other window visible.

UseOC

Optional content group panel is visible.

UseAttachments

Document attachments are visible.

PageLayout

The page layout to be used when the document is opened. Possible values:

SinglePage

Displays one page at a time.

OneColumn

Displays the pages in one column.

TwoColumnLeft

Displays the pages in two columns, with odd-numbered pages on the left.

TwoColumnRight

Displays the pages in two columns, with odd-numbered pages on the right.

NonFullScreenPageMode

The document page mode when the pdf viewer application exits the full screen mode. Possible values:

UseNone

Neither document outline (bookmarks) nor thumbnail images are visible.

UseOutlines

Document outline (bookmarks) are visible.

UseThumbs

Thumbnail images are visible.

UseOC

Optional content group panel is visible.

Code Sample
// set the pdf viewer preferences
doc.ViewerPreferences.CenterWindow = true;
doc.ViewerPreferences.DisplayDocTitle = true;
doc.ViewerPreferences.FitWindow = true;
doc.ViewerPreferences.HideMenuBar = true;
doc.ViewerPreferences.HideToolbar = true;
doc.ViewerPreferences.HideWindowUI = false;

doc.ViewerPreferences.NonFullScreenPageMode = PdfViewerFullScreenExitMode.UseNone;
doc.ViewerPreferences.PageLayout = PdfViewerPageLayout.SinglePage;
doc.ViewerPreferences.PageMode = PdfViewerPageMode.UseNone;
See Also