PTPDFDocViewPrefs
@interface PTPDFDocViewPrefs : NSObject
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.
-
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.
Example:
Destination dest = Destination::CreateFit(page); pdfdoc.GetViewPrefs().SetInitialPage(dest);
Declaration
Objective-C
- (void)SetInitialPage:(PTDestination *)dest;
Swift
func setInitialPage(_ dest: PTDestination!)
Parameters
dest
A value specifying the page destination to be displayed when the document is opened.
-
Sets PageMode property and change the value of the PageMode key in the Catalog dictionary.
Declaration
Objective-C
- (void)SetPageMode:(PTPageMode)mode;
Swift
func setPageMode(_ mode: PTPageMode)
Parameters
mode
New PageMode setting. Default value is e_UseNone.
-
Return Value
The value of currently selected PageMode property.
-
Sets PageLayout property and change the value of the PageLayout key in the Catalog dictionary.
Declaration
Objective-C
- (void)SetLayoutMode:(PTPageLayout)layout;
Swift
func setLayoutMode(_ layout: PTPageLayout)
Parameters
mode
New PageLayout setting. Default value is e_SinglePage.
-
Return Value
The value of currently selected PageLayout property.
-
Sets the value of given ViewerPref property.
Declaration
Objective-C
- (void)SetPref:(PTViewerPref)pref value:(BOOL)value;
Swift
func setPref(_ pref: PTViewerPref, value: Bool)
Parameters
pref
the ViewerPref property type to modify.
value
The new value for the property.
-
Declaration
Objective-C
- (BOOL)GetPref:(PTViewerPref)pref;
Swift
func getPref(_ pref: PTViewerPref) -> Bool
Parameters
pref
the ViewerPref property type to query.
Return Value
the value of given ViewerPref property.
-
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.
Declaration
Objective-C
- (void)SetNonFullScreenPageMode:(PTPageMode)mode;
Swift
func setNonFullScreenPageMode(_ mode: PTPageMode)
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.Declaration
Objective-C
- (PTPageMode)GetNonFullScreenPageMode;
Swift
func getNonFullScreenPageMode() -> PTPageMode
Return Value
the PageMode used after exiting full-screen mode.
-
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.
Declaration
Objective-C
- (void)SetDirection:(BOOL)left_to_right;
Swift
func setDirection(_ left_to_right: Bool)
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.
-
Declaration
Objective-C
- (BOOL)GetDirection;
Swift
func getDirection() -> Bool
Return Value
true is the predominant reading order for text is left to right, false otherwise. See SetDirection() for more information.
-
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.