PDFViewController

  • Sets the buttons to be shown in the main toolbar (ornament at top) on visionOS for a particular view mode (ViewMode). The order in which the items are specified is important. You can add your own custom item to the toolbar (see OrnamentItem).

    Usage:

    let pdfController = PDFViewController(document: ...)
    
    // Specify the ornament items to be displayed for the document view mode (`ViewMode.document`)
    pdfController.setMainToolbarOrnamentItems([
        pdfController.backOrnamentItem,
        pdfController.titleOrnamentItem,
        OrnamentItem(kind: .divider),
        pdfController.annotationToolsOrnamentItem,
        pdfController.thumbnailsOrnamentItem
    ], for: .document)
    
    // Ornament items for the thumbnails view mode (`ViewMode.thumbnails`)
    pdfController.setMainToolbarOrnamentItems([
        pdfController.backOrnamentItem,
        pdfController.titleOrnamentItem,
        OrnamentItem(kind: .divider),
        pdfController.thumbnailsOrnamentItem
    ], for: .document)
    
  • Displays the back button that allows the user to dimiss the PDFViewController.

  • Displays the title of the document. If you wish to display a custom title then please consider creating your own OrnamentItem instance of .title kind.

  • Shows and hides the AnnotationToolbar toolbar for creating annotations.

    @note Requires the Features.annotationEditing feature flag.

  • Toggles between the document and the document editor view state (ViewMode.documentEditor).

    @note Requires the Document Editor component (Features.documentEditing) to be enabled for your license.

    @see ViewMode @see setViewMode(_:animated:)

  • An ornament button that adds or removes the bookmark for the currently visible page defined by PDFViewController.pageIndex.

  • Transitions to the .contentEditing view mode.

    Important

    Using this ornament item requires Content Editing feature to be included in your license.

  • Toggles between the document and the thumbnails view state (ViewMode.thumbnails).

    @see ViewMode @see setViewMode(_:animated:)

  • Presents the SearchViewController or the InlineSearchManager for searching text in the current document.

    @see SearchMode in PDFConfiguration to configure this.

  • An ornament item that shows Reader View, which reformats document text into an easy-to-read, single-column view that’s optimized for mobile devices.

    This ornament item is not included by default. It must be programatically added to the ornament items using PDFViewController.setMainToolbarOrnamentItems(_:viewMode:).

    Reader View can also be presented programatically using the ReaderViewController class.

    @note Requires the Reader View component (Features.readerView) to be enabled for your license.

    @see https://pspdfkit.com/guides/ios/features/reader-view/ for further documentation.

  • Shows a user interface for adding a signature to the document.

    @note Requires the Electronic Signatures feature (Features.electronicSignatures) to be enabled in your license.

  • Presents the sharing UI (PDFDocumentSharingViewController) for various sharing destinations defined in the DocumentSharingConfiguration add to the PDFConfiguration for the current PDFViewController.

  • Presents the view controller of the documentInfoCoordinator, which show information like the document outline and bookmarks.

  • Presents the PDFSettingsViewController to control some aspects of PSPDFViewController UX.