PSPDFPageControls

Objective-C

@protocol PSPDFPageControls <NSObject>

Swift

protocol PageControls : NSObjectProtocol

Protocol for handling page changes.

  • Set the page to a specific page index.

    Declaration

    Objective-C

    - (void)setPageIndex:(PSPDFPageIndex)pageIndex animated:(BOOL)animated;

    Swift

    func setPageIndex(_ pageIndex: PageIndex, animated: Bool)

    Parameters

    pageIndex

    Page index of the page that should be shown.

    animated

    Defines if changing the page should be animated.

  • Set the view mode.

    Declaration

    Objective-C

    - (void)setViewMode:(PSPDFViewMode)viewMode animated:(BOOL)animated;

    Swift

    func setViewMode(_ viewMode: ViewMode, animated: Bool)

    Parameters

    viewMode

    View mode to change to.

    animated

    Defines if changing the view mode should be animated.

  • Executes a passed in PDF action.

    Declaration

    Objective-C

    - (BOOL)executePDFAction:(nullable PSPDFAction *)action
                  targetRect:(CGRect)targetRect
                   pageIndex:(PSPDFPageIndex)pageIndex
                    animated:(BOOL)animated
             actionContainer:(nullable id)actionContainer;

    Swift

    func execute(_ action: Action?, targetRect: CGRect, pageIndex: PageIndex, animated: Bool, actionContainer: Any?) -> Bool

    Parameters

    action

    The action to execute.

    targetRect

    The rect that triggered this action in the receiver’s view coordinate space.

    pageIndex

    The current page index. This is used for relative actions like NamedActionType.nextPage and to register a back action in the back-forward action list.

    animated

    Whether the transition the action is describing should be animated.

    actionContainer

    The sender that triggered the execution of this action, such as an annotation or a button.

    Return Value

    Whether the action or at least one of its sub-actions should be added to the back-forward action list.

  • Go forward in the navigation history if possible.

    Declaration

    Objective-C

    - (void)navigateForwardAnimated:(BOOL)animated;

    Swift

    func navigateForward(animated: Bool)
  • Go back in the navigation history if possible.

    Declaration

    Objective-C

    - (void)navigateBackAnimated:(BOOL)animated;

    Swift

    func navigateBack(animated: Bool)
  • Search for a specific string.

    Declaration

    Objective-C

    - (void)searchForString:(nullable NSString *)searchText
                    options:(nullable NSDictionary<PSPDFPresentationOption, id> *)
                                options
                     sender:(nullable id)sender
                   animated:(BOOL)animated;

    Swift

    func search(for searchText: String?, options: [PresentationOption : Any]? = nil, sender: Any?, animated: Bool)
  • Presents the document info view controller.

    Declaration

    Objective-C

    - (nullable UIViewController *)
        presentDocumentInfoViewControllerWithOptions:
            (nullable NSDictionary<PSPDFPresentationOption, id> *)options
                                              sender:(nullable id)sender
                                            animated:(BOOL)animated
                                          completion:
                                              (nullable void (^)(void))completion;

    Swift

    func presentDocumentInfoViewController(options: [PresentationOption : Any]? = nil, sender: Any?, animated: Bool, completion: (() -> Void)? = nil) -> UIViewController?
  • Allows file preview using QuickLook.

    Declaration

    Objective-C

    - (void)presentPreviewControllerForURL:(nonnull NSURL *)fileURL
                                     title:(nullable NSString *)title
                                   options:
                                       (nullable NSDictionary<
                                           PSPDFPresentationOption, id> *)options
                                    sender:(nullable id)sender
                                  animated:(BOOL)animated
                                completion:(nullable void (^)(void))completion;

    Swift

    func presentPreviewController(for fileURL: URL, title: String?, options: [PresentationOption : Any]? = nil, sender: Any?, animated: Bool) async
  • Reloads the displayed controller and view.

    Declaration

    Objective-C

    - (void)reloadData;

    Swift

    func reloadData()
  • Invokes the print share action.

    Declaration

    Objective-C

    - (void)printButtonPressed:(nullable id)sender;

    Swift

    func printButtonPressed(_ sender: Any?)