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.

  • Declaration

    Objective-C

    - (PTPageMode)GetPageMode;

    Swift

    func getPageMode() -> PTPageMode

    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.

  • Declaration

    Objective-C

    - (PTPageLayout)GetLayoutMode;

    Swift

    func getLayoutMode() -> PTPageLayout

    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.

    Declaration

    Objective-C

    - (void)SetViewArea:(PTBox)box;

    Swift

    func setViewArea(_ box: PTBox)

    Parameters

    box

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

  • Declaration

    Objective-C

    - (PTBox)GetViewArea;

    Swift

    func getViewArea() -> PTBox

    Return Value

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

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

    Declaration

    Objective-C

    - (void)SetViewClip:(PTBox)box;

    Swift

    func setViewClip(_ box: PTBox)

    Parameters

    box

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

  • Declaration

    Objective-C

    - (PTBox)GetViewClip;

    Swift

    func getViewClip() -> PTBox

    Return Value

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

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

    Declaration

    Objective-C

    - (void)SetPrintArea:(PTBox)box;

    Swift

    func setPrintArea(_ box: PTBox)

    Parameters

    box

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

  • Declaration

    Objective-C

    - (PTBox)GetPrintArea;

    Swift

    func getPrintArea() -> PTBox

    Return Value

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

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

    Declaration

    Objective-C

    - (void)SetPrintClip:(PTBox)box;

    Swift

    func setPrintClip(_ box: PTBox)

    Parameters

    box

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

  • Declaration

    Objective-C

    - (PTBox)GetPrintClip;

    Swift

    func getPrintClip() -> PTBox

    Return Value

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

  • Declaration

    Objective-C

    - (PTObj *)GetSDFObj;

    Swift

    func getSDFObj() -> PTObj!

    Return Value

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

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

    Declaration

    Objective-C

    - (instancetype)initWithTr:(PTObj *)tr;

    Swift

    init!(tr: PTObj!)