pdftron::PDF::PDFDocViewPrefs Class Reference

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. More...

#include <PDFDocViewPrefs.h>

List of all members.

Public Types

enum  PageMode {
  e_UseNone, e_UseThumbs, e_UseBookmarks, e_FullScreen,
  e_UseOC, e_UseAttachments
}
 PageMode specifies how the document should be displayed when opened:. More...
enum  PageLayout {
  e_Default, e_SinglePage, e_OneColumn, e_TwoColumnLeft,
  e_TwoColumnRight, e_TwoPageLeft, e_TwoPageRight
}
 PageLayout specifies the page layout to be used when the document is opened:. More...
enum  ViewerPref {
  e_HideToolbar, e_HideMenubar, e_HideWindowUI, e_FitWindow,
  e_CenterWindow, e_DisplayDocTitle
}
 ViewerPref enumeration specifies how various GUI elements should behave when the document is opened. More...

Public Member Functions

void SetInitialPage (Destination &dest)
 A utility method used to set the fist page displayed after the document is opened.
void SetPageMode (PageMode mode)
 Sets PageMode property and change the value of the PageMode key in the Catalog dictionary.
PageMode GetPageMode ()
 
Returns:
The value of currently selected PageMode property.

void SetLayoutMode (PageLayout layout)
 Sets PageLayout property and change the value of the PageLayout key in the Catalog dictionary.
PageLayout GetLayoutMode ()
 
Returns:
The value of currently selected PageLayout property.

void SetPref (ViewerPref pref, bool value)
 Sets the value of given ViewerPref property.
bool GetPref (ViewerPref pref)
 
Returns:
the value of given ViewerPref property.

void SetNonFullScreenPageMode (PageMode mode)
 Set the document’s page mode, specifying how to display the document on exiting full-screen mode.
PageMode GetNonFullScreenPageMode ()
 
Returns:
the PageMode used after exiting full-screen mode.

void SetDirection (bool left_to_right)
 Sets the predominant reading order for text.
bool GetDirection ()
 
Returns:
true is the predominant reading order for text is left to right, false otherwise.

void SetViewArea (Page::Box box)
 Sets the page boundary representing the area of a page to be displayed when viewing the document on the screen.
Page::Box GetViewArea ()
 
Returns:
the page boundary representing the area of a page to be displayed when viewing the document on the screen.

void 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.
Page::Box GetViewClip ()
 
Returns:
the page boundary to which the contents of a page are to be clipped when viewing the document on the screen.

void SetPrintArea (Page::Box box)
 Sets the page boundary representing the area of a page to be rendered when printing the document.
Page::Box GetPrintArea ()
 
Returns:
the page boundary representing the area of a page to be rendered when printing the document.

void SetPrintClip (Page::Box box)
 Sets the page boundary to which the contents of a page are to be clipped when printing the document.
Page::Box GetPrintClip ()
 
Returns:
the page boundary to which the contents of a page are to be clipped when printing the document.

SDF::Obj GetSDFObj ()
 
Returns:
document’s SDF/Cos 'ViewerPreferences' dictionary or NULL if the object is not present.

 PDFDocViewPrefs (SDF::Obj tr)
 PDFDocViewPrefs constructor.
 PDFDocViewPrefs (const PDFDocViewPrefs &)
PDFDocViewPrefsoperator= (const 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.


Member Enumeration Documentation

enum pdftron::PDF::PDFDocViewPrefs::PageMode

PageMode specifies how the document should be displayed when opened:.

Enumerator:
e_UseNone 
e_UseThumbs 
e_UseBookmarks 
e_FullScreen 
e_UseOC 
e_UseAttachments 

enum pdftron::PDF::PDFDocViewPrefs::PageLayout

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

Enumerator:
e_Default 
e_SinglePage 
e_OneColumn 
e_TwoColumnLeft 
e_TwoColumnRight 
e_TwoPageLeft 
e_TwoPageRight 

enum pdftron::PDF::PDFDocViewPrefs::ViewerPref

ViewerPref enumeration specifies how various GUI elements should behave when the document is opened.

Enumerator:
e_HideToolbar 
e_HideMenubar 
e_HideWindowUI 
e_FitWindow 
e_CenterWindow 
e_DisplayDocTitle 


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  ) 


Member Function Documentation

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:
dest A 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::SetPageMode ( PageMode  mode  ) 

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

Parameters:
mode New PageMode setting. Default value is e_UseNone.

PageMode pdftron::PDF::PDFDocViewPrefs::GetPageMode (  ) 

Returns:
The value of currently selected PageMode property.

void pdftron::PDF::PDFDocViewPrefs::SetLayoutMode ( PageLayout  layout  ) 

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

Parameters:
mode New PageLayout setting. Default value is e_SinglePage.

PageLayout pdftron::PDF::PDFDocViewPrefs::GetLayoutMode (  ) 

Returns:
The value of currently selected PageLayout property.

void pdftron::PDF::PDFDocViewPrefs::SetPref ( ViewerPref  pref,
bool  value 
)

Sets the value of given ViewerPref property.

Parameters:
pref the ViewerPref property type to modify.
value The new value for the property.

bool pdftron::PDF::PDFDocViewPrefs::GetPref ( ViewerPref  pref  ) 

Returns:
the value of given ViewerPref property.

Parameters:
pref the ViewerPref property type to query.

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:
mode PageMode 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.

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.

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.

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.

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:
box page boundary displayed when viewing the document on the screen. By default, PDF viewers will display the crop-box.

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.

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:
box screen clip region. The default value is page crop-box.

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.

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:
box printing region. The default value is page crop-box.

Page::Box pdftron::PDF::PDFDocViewPrefs::GetPrintArea (  ) 

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

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:
box printing clip region. The default value is page crop-box.

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.

PDFDocViewPrefs& pdftron::PDF::PDFDocViewPrefs::operator= ( const PDFDocViewPrefs  ) 


© 2002-2008 PDFTron Systems Inc.