All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pdftron::PDF::PDFDocViewPrefs Class Reference

#include <PDFDocViewPrefs.h>

Public Types

enum  PageMode {
  e_UseNone, e_UseThumbs, e_UseBookmarks, e_FullScreen,
  e_UseOC, e_UseAttachments
}
 
enum  PageLayout {
  e_Default, e_SinglePage, e_OneColumn, e_TwoColumnLeft,
  e_TwoColumnRight, e_TwoPageLeft, e_TwoPageRight
}
 
enum  ViewerPref {
  e_HideToolbar, e_HideMenubar, e_HideWindowUI, e_FitWindow,
  e_CenterWindow, e_DisplayDocTitle
}
 

Public Member Functions

void SetInitialPage (Destination &dest)
 
void SetPageMode (PageMode mode)
 
PageMode GetPageMode ()
 
void SetLayoutMode (PageLayout layout)
 
PageLayout GetLayoutMode ()
 
void SetPref (ViewerPref pref, bool value)
 
bool GetPref (ViewerPref pref)
 
void SetNonFullScreenPageMode (PageMode mode)
 
PageMode GetNonFullScreenPageMode ()
 
void SetDirection (bool left_to_right)
 
bool GetDirection ()
 
void SetViewArea (Page::Box box)
 
Page::Box GetViewArea ()
 
void SetViewClip (Page::Box box)
 
Page::Box GetViewClip ()
 
void SetPrintArea (Page::Box box)
 
Page::Box GetPrintArea ()
 
void SetPrintClip (Page::Box box)
 
Page::Box GetPrintClip ()
 
SDF::Obj GetSDFObj ()
 
 PDFDocViewPrefs (SDF::Obj tr)
 
 PDFDocViewPrefs (const PDFDocViewPrefs &)
 
PDFDocViewPrefsoperator= (const PDFDocViewPrefs &)
 
 PDFDocViewPrefs ()
 

Detailed Description

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.

Definition at line 25 of file PDFDocViewPrefs.h.

Member Enumeration Documentation

PageLayout specifies the page layout to be used when the document is opened:

  • e_Default PageLayout is not explicitly specified, use user defined preferred layout.
  • 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.
Enumerator
e_Default 
e_SinglePage 
e_OneColumn 
e_TwoColumnLeft 
e_TwoColumnRight 
e_TwoPageLeft 
e_TwoPageRight 

Definition at line 110 of file PDFDocViewPrefs.h.

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.
Enumerator
e_UseNone 
e_UseThumbs 
e_UseBookmarks 
e_FullScreen 
e_UseOC 
e_UseAttachments 

Definition at line 61 of file PDFDocViewPrefs.h.

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.
Enumerator
e_HideToolbar 
e_HideMenubar 
e_HideWindowUI 
e_FitWindow 
e_CenterWindow 
e_DisplayDocTitle 

Definition at line 166 of file PDFDocViewPrefs.h.

Constructor & Destructor Documentation

pdftron::PDF::PDFDocViewPrefs::PDFDocViewPrefs ( SDF::Obj  tr)

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

pdftron::PDF::PDFDocViewPrefs::PDFDocViewPrefs ( const PDFDocViewPrefs )
pdftron::PDF::PDFDocViewPrefs::PDFDocViewPrefs ( )

Member Function Documentation

bool pdftron::PDF::PDFDocViewPrefs::GetDirection ( )
Returns
true is the predominant reading order for text is left to right, false otherwise. See SetDirection() for more information.
PageLayout pdftron::PDF::PDFDocViewPrefs::GetLayoutMode ( )
Returns
The value of currently selected PageLayout property.
PageMode pdftron::PDF::PDFDocViewPrefs::GetNonFullScreenPageMode ( )
Returns
the PageMode used after 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.
PageMode pdftron::PDF::PDFDocViewPrefs::GetPageMode ( )
Returns
The value of currently selected PageMode property.
bool pdftron::PDF::PDFDocViewPrefs::GetPref ( ViewerPref  pref)
Returns
the value of given ViewerPref property.
Parameters
prefthe ViewerPref property type to query.
Page::Box pdftron::PDF::PDFDocViewPrefs::GetPrintArea ( )
Returns
the page boundary representing the area of a page to be rendered when printing the document.
Page::Box pdftron::PDF::PDFDocViewPrefs::GetPrintClip ( )
Returns
the page boundary to which the contents of a page are to be clipped when printing the document.
SDF::Obj pdftron::PDF::PDFDocViewPrefs::GetSDFObj ( )
Returns
document's SDF/Cos 'ViewerPreferences' dictionary or NULL if the object is not present.
Page::Box pdftron::PDF::PDFDocViewPrefs::GetViewArea ( )
Returns
the page boundary representing the area of a page to be displayed when viewing the document on the screen.
Page::Box pdftron::PDF::PDFDocViewPrefs::GetViewClip ( )
Returns
the page boundary to which the contents of a page are to be clipped when viewing the document on the screen.
PDFDocViewPrefs& pdftron::PDF::PDFDocViewPrefs::operator= ( const PDFDocViewPrefs )
void pdftron::PDF::PDFDocViewPrefs::SetDirection ( bool  left_to_right)

Sets 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.
void pdftron::PDF::PDFDocViewPrefs::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
destA value specifying the page destination to be displayed when the document is opened.

Example:

Destination dest = Destination::CreateFit(page);
pdfdoc.GetViewPrefs().SetInitialPage(dest);
void pdftron::PDF::PDFDocViewPrefs::SetLayoutMode ( PageLayout  layout)

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

Parameters
modeNew PageLayout setting. Default value is e_SinglePage.
void pdftron::PDF::PDFDocViewPrefs::SetNonFullScreenPageMode ( PageMode  mode)

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

Parameters
modePageMode used after exiting full-screen mode. Default value: e_UseNone.
Note
This entry is meaningful only if the value of the PageMode is set to e_FullScreen; it is ignored otherwise.
void pdftron::PDF::PDFDocViewPrefs::SetPageMode ( PageMode  mode)

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

Parameters
modeNew PageMode setting. Default value is e_UseNone.
void pdftron::PDF::PDFDocViewPrefs::SetPref ( ViewerPref  pref,
bool  value 
)

Sets the value of given ViewerPref property.

Parameters
prefthe ViewerPref property type to modify.
valueThe new value for the property.
void pdftron::PDF::PDFDocViewPrefs::SetPrintArea ( Page::Box  box)

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

Parameters
boxprinting region. The default value is page crop-box.
void pdftron::PDF::PDFDocViewPrefs::SetPrintClip ( Page::Box  box)

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

Parameters
boxprinting clip region. The default value is page crop-box.
void pdftron::PDF::PDFDocViewPrefs::SetViewArea ( Page::Box  box)

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

Parameters
boxpage boundary displayed when viewing the document on the screen. By default, PDF viewers will display the crop-box.
void pdftron::PDF::PDFDocViewPrefs::SetViewClip ( Page::Box  box)

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

Parameters
boxscreen clip region. The default value is page crop-box.

The documentation for this class was generated from the following file: