PTDocumentBaseViewController

A view controller that displays a PTPDFViewCtrl along with other controls.

  • Returns an initialized PTDocumentBaseViewController.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()

    Return Value

    an initialized PTDocumentBaseViewController.

  • The view controller’s underlying PTPDFViewCtrl.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) PTPDFViewCtrl *_Nonnull pdfViewCtrl;

    Swift

    var pdfViewCtrl: PTPDFViewCtrl { get }
  • The tool manager attached to the underlying PTPDFViewCtrl.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) PTToolManager *_Nonnull toolManager;

    Swift

    var toolManager: PTToolManager { get }
  • Open a document with the given URL.

    Declaration

    Objective-C

    - (void)openDocumentWithURL:(nonnull NSURL *)url;

    Swift

    func openDocument(with url: URL)

    Parameters

    url

    The URL to open.

  • Open a document with the given URL and password.

    Declaration

    Objective-C

    - (void)openDocumentWithURL:(nonnull NSURL *)url
                       password:(nullable NSString *)password;

    Swift

    func openDocument(with url: URL, password: String?)

    Parameters

    url

    The URL to open.

    password

    The password for the document.

  • Open a document with the given URL and options.

    Declaration

    Objective-C

    - (void)openDocumentWithURL:(nonnull NSURL *)url
                        options:(nullable PTDocumentOptions *)options;

    Swift

    func openDocument(with url: URL, options: PTDocumentOptions?)

    Parameters

    url

    The URL to open

    options

    The options for the opening the document

  • Open the given PTPDFDoc.

    Declaration

    Objective-C

    - (void)openDocumentWithPDFDoc:(nonnull PTPDFDoc *)document;

    Swift

    func openDocument(with document: PTPDFDoc)

    Parameters

    document

    The PTPDFDoc to open.

  • PTHTTPRequestOptions that will be used when requesting remote documents over HTTP. These can be used to set additional HTTP headers and control if a linearized document should be downloaded in its entirety, or only the parts that are viewed.

    Declaration

    Objective-C

    @property (nonatomic, strong, nonnull) PTHTTPRequestOptions *httpRequestOptions;

    Swift

    var httpRequestOptions: PTHTTPRequestOptions { get set }
  • Specifies additional http headers which will be set on outgoing requests and when requesting remote documents over HTTP.

    Headers specified in this dictionary will overwrite any (matching) existing headers in the httpRequestOptions property.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalHTTPHeaders;

    Swift

    var additionalHTTPHeaders: [String : String]? { get set }
  • Options that will be used when converting documents with the PTConvert APIs via the -openDocumentWithURL: method.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTConversionOptions *_Nonnull conversionOptions;

    Swift

    var conversionOptions: PTConversionOptions { get set }
  • The PTPDFDoc if the viewer is displaying a document opened with openDocumentWithPDFDoc:.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) PTPDFDoc *document;

    Swift

    var document: PTPDFDoc? { get }
  • The PTCoordinatedDocument if the viewer opens a local file with openDocumentWithURL:.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) PTCoordinatedDocument *coordinatedDocument;

    Swift

    var coordinatedDocument: PTCoordinatedDocument? { get }
  • The PTPDFDocumentFile instance if the viewer opens a local file with openDocumentWithURL:.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) PTPDFDocumentFile *documentFile;

    Swift

    var documentFile: PTPDFDocumentFile? { get }
  • Save the current document with the default options.

    Declaration

    Objective-C

    - (void)saveDocumentWithCompletionHandler:
        (void (^_Nullable)(BOOL))completionHandler;

    Swift

    func saveDocument() async -> Bool

    Parameters

    completionHandler

    A block with code that is executed when the save operation concludes. The block returns no value, and the success param is YES if the save operation succeeds, otherwise NO.

  • Save the current document with the specified options.

    If the saveOptions include the e_ptincremental flag, and it is not possible to save incrementally (e.g. in the case that the xref table needed to be repaired), then the incremental flag will be ignored.

    Declaration

    Objective-C

    - (void)saveDocument:(PTSaveOptions)saveOptions
        completionHandler:(nullable void (^)(BOOL))completionHandler;

    Swift

    func saveDocument(_ saveOptions: PTSaveOptions) async -> Bool

    Parameters

    saveOptions

    The options to save the document with.

    completionHandler

    A block with code that is executed when the save operation concludes. The block returns no value, and the success param is YES if the save operation succeeds, otherwise NO.

  • Whether changes in the document are saved automatically. The default value is YES. The document is saved on best-effort basis on a timer with a period of automaticDocumentSavingInterval. The document is also saved when the app resigns the foreground, or this ViewController’s view disappears.

    Declaration

    Objective-C

    @property (nonatomic) BOOL automaticallySavesDocument;

    Swift

    var automaticallySavesDocument: Bool { get set }
  • The interval in seconds that the document is automatically saved.

    The default value is PTDocumentViewControllerSaveDocumentInterval.

    Setting the interval to DBL_MAX disables the timer entirely.

    Declaration

    Objective-C

    @property (nonatomic) NSTimeInterval automaticDocumentSavingInterval;

    Swift

    var automaticDocumentSavingInterval: TimeInterval { get set }
  • If a save is attempted, and cannot be completed, a UIAlertController is shown with the title “Saving Error”. The errorMessage string is the message detail that is displayed. The default value is “The document could not be saved due to an error.”.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull saveErrorMessage;

    Swift

    var saveErrorMessage: String { get set }
  • The message shown while loading an image or any other file types that are convertible by PDFTron or loading a remote document. When the value is not set it shows “Opening PDF…”.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *documentLoadingMessage;

    Swift

    var documentLoadingMessage: String? { get set }
  • Restart the automatic document saving timer with the interval specified in the automaticDocumentSavingInterval property.

    Declaration

    Objective-C

    - (void)restartAutomaticDocumentSavingTimer;

    Swift

    func restartAutomaticDocumentSavingTimer()
  • Restart the automatic document saving timer with the specified interval.

    The automaticDocumentSavingInterval property is updated with the specified interval.

    Declaration

    Objective-C

    - (void)restartAutomaticDocumentSavingTimerWithInterval:
        (NSTimeInterval)interval;

    Swift

    func restartAutomaticDocumentSavingTimer(withInterval interval: TimeInterval)

    Parameters

    interval

    The interval to use for automatic document saving.

  • Stop the automatic document saving timer.

    Declaration

    Objective-C

    - (void)stopAutomaticDocumentSavingTimer;

    Swift

    func stopAutomaticDocumentSavingTimer()
  • In cases where the original document cannot be saved back to its source location, and the view controller is being deallocated and its document contains unsaved changes, this property controls whether a backup copy of the document is saved to disk.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isDocumentBackupSavingEnabled)
        BOOL documentBackupSavingEnabled;

    Swift

    var isDocumentBackupSavingEnabled: Bool { get set }
  • The file URL of the directory where document backups should be saved.

    The default value of this property is the application’s user-visible Documents/ directory.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSURL *documentBackupDirectoryURL;

    Swift

    var documentBackupDirectoryURL: URL? { get set }
  • Whether tapping on the right or left edges of the page in single page-presentation mode (non-continuous) will change the current page to the next or previous page, respectively.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL changesPageOnTap;

    Swift

    var changesPageOnTap: Bool { get set }
  • Whether the pdfViewCtrl page fits between the top navigation bar and bottom toolbar. When disabled, the page content will fit to the size of this view controller and scroll if necessary; when enabled, the page content will fit in the visible space between the bars without scrolling (at the minimum zoom scale).

    This property controls the view controller’s edgesForExtendedLayout property: the UIRectEdgeTop and UIRectEdgeBottom values are excluded from that bitmask property when the pageFitsBetweenBars property is enabled.

    The isTranslucent property of the PTThumbnailSliderViewController.toolbar is also affected by the pageFitsBetweenBars property: when this property is enabled, the thumbnail slider’s toolbar is set to be non-translucent. Otherwise, the toolbar is translucent.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL pageFitsBetweenBars;
  • Whether night mode is enabled for the pdfViewCtrl. The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isNightModeEnabled) BOOL nightModeEnabled;

    Swift

    var isNightModeEnabled: Bool { get set }
  • Controls if the ThumbnailSlider is enabled.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isBottomToolbarEnabled) BOOL bottomToolbarEnabled;

    Swift

    var isBottomToolbarEnabled: Bool { get set }
  • Controls if the thumbnailSliderController is enabled.

    The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isThumbnailSliderEnabled) BOOL thumbnailSliderEnabled;

    Swift

    var isThumbnailSliderEnabled: Bool { get set }
  • Controls if the PTPageIndicatorViewController is enabled. The default value is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isPageIndicatorEnabled) BOOL pageIndicatorEnabled;

    Swift

    var isPageIndicatorEnabled: Bool { get set }
  • Whether the PTPageIndicatorViewController is shown when the current page changes. The default value is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL pageIndicatorShowsOnPageChange;

    Swift

    var pageIndicatorShowsOnPageChange: Bool { get set }
  • Whether the PTPageIndicatorViewController is shown with the navigation bar and toolbars. The default value is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL pageIndicatorShowsWithControls;

    Swift

    var pageIndicatorShowsWithControls: Bool { get set }
  • Whether the PTPageIndicatorViewController is always visible. If false, the indicator will fade away when the toolbars hide, or after a short period of time looking at the same page. The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL pageIndicatorAlwaysVisible;

    Swift

    var pageIndicatorAlwaysVisible: Bool { get set }
  • Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull readerModeButtonItem;

    Swift

    var readerModeButtonItem: UIBarButtonItem { get }
  • Shows the PTTextSearchViewController toolbar for text search.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull searchButtonItem;

    Swift

    var searchButtonItem: UIBarButtonItem { get }
  • Shows options for exporting the document.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull exportButtonItem;

    Swift

    var exportButtonItem: UIBarButtonItem { get }
  • Exports a copy of the document.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull exportCopyButtonItem;

    Swift

    var exportCopyButtonItem: UIBarButtonItem { get }
  • Exports a flattened copy of the document.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull exportFlattenedCopyButtonItem;

    Swift

    var exportFlattenedCopyButtonItem: UIBarButtonItem { get }
  • Exports a reduced file size copy of the document.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull exportReducedFileSizeCopyButtonItem;

    Swift

    var exportReducedFileSizeCopyButtonItem: UIBarButtonItem { get }
  • Exports a cropped copy of the document.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull exportCroppedCopyButtonItem;

    Swift

    var exportCroppedCopyButtonItem: UIBarButtonItem { get }
  • Shows a UIDocumentInteractionController for the current document.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull shareButtonItem;

    Swift

    var shareButtonItem: UIBarButtonItem { get }
  • Shows a PTDocumentViewSettingsController to control the view settings.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull settingsButtonItem;

    Swift

    var settingsButtonItem: UIBarButtonItem { get }
  • Shows a PTToolsSettingsViewController to control the view settings.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull appSettingsButtonItem;

    Swift

    var appSettingsButtonItem: UIBarButtonItem { get }
  • Shows a PTThumbnailsViewController for the current document.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull thumbnailsButtonItem;

    Swift

    var thumbnailsButtonItem: UIBarButtonItem { get }
  • Shows a PTNavigationListsViewController with outline, annotations, and bookmarks view controllers.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull navigationListsButtonItem;

    Swift

    var navigationListsButtonItem: UIBarButtonItem { get }
  • Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull moreItemsButtonItem;

    Swift

    var moreItemsButtonItem: UIBarButtonItem { get }
  • Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull addPagesButtonItem;

    Swift

    var addPagesButtonItem: UIBarButtonItem { get }
  • Adds a bookmark to the current page, or removes the existing bookmark of the current page.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIBarButtonItem *_Nonnull bookmarkPageButtonItem;

    Swift

    var bookmarkPageButtonItem: UIBarButtonItem { get }
  • Controls the visibility of the readerModeButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isReaderModeButtonHidden) BOOL readerModeButtonHidden;

    Swift

    var isReaderModeButtonHidden: Bool { get set }
  • Controls the visibility of the settingsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isViewerSettingsButtonHidden) BOOL viewerSettingsButtonHidden;

    Swift

    var isViewerSettingsButtonHidden: Bool { get set }
  • Controls the visibility of the appSettingsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isAppSettingsButtonHidden) BOOL appSettingsButtonHidden;

    Swift

    var isAppSettingsButtonHidden: Bool { get set }
  • Controls the visibility of the shareButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isShareButtonHidden) BOOL shareButtonHidden;

    Swift

    var isShareButtonHidden: Bool { get set }
  • Controls the visibility of the searchButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isSearchButtonHidden) BOOL searchButtonHidden;

    Swift

    var isSearchButtonHidden: Bool { get set }
  • Controls the visibility of the export button in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isExportButtonHidden) BOOL exportButtonHidden;

    Swift

    var isExportButtonHidden: Bool { get set }
  • Controls the visibility of the moreItemsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isMoreItemsButtonHidden) BOOL moreItemsButtonHidden;

    Swift

    var isMoreItemsButtonHidden: Bool { get set }
  • Controls the visibility of the addPagesButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isAddPagesButtonHidden) BOOL addPagesButtonHidden;

    Swift

    var isAddPagesButtonHidden: Bool { get set }
  • Controls the visibility of the bookmarkPageButtonItem in the navigation bar, bottom toolbar.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isBookmarkPageButtonHidden) BOOL bookmarkPageButtonHidden;

    Swift

    var isBookmarkPageButtonHidden: Bool { get set }
  • Controls the visibility of the thumbnailsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isThumbnailBrowserButtonHidden)
        BOOL thumbnailBrowserButtonHidden;

    Swift

    var isThumbnailBrowserButtonHidden: Bool { get set }
  • Controls the visibility of the navigationListsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isNavigationListsButtonHidden)
        BOOL navigationListsButtonHidden;

    Swift

    var isNavigationListsButtonHidden: Bool { get set }
  • The toolbar items associated with the view controller.

    The getter for this property returns -toolbarItemsForSizeClass: for the current horizontal user interface size class, and the setters uses -setToolbarItems:forSizeClass:animated: to set the toolbar items for all user interface size classes.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *toolbarItems;

    Swift

    var toolbarItems: [UIBarButtonItem]? { get set }
  • Returns the toolbarItems for the given horizontal user interface size class.

    Declaration

    Objective-C

    - (nullable NSArray<UIBarButtonItem *> *)toolbarItemsForSizeClass:
        (UIUserInterfaceSizeClass)sizeClass;

    Swift

    func toolbarItems(for sizeClass: UIUserInterfaceSizeClass) -> [UIBarButtonItem]?

    Parameters

    sizeClass

    the horizontal user interface size class for which to get the list of items

    Return Value

    the toolbarItems for the given horizontal user interface size class

  • Sets the toolbarItems used for the given horizontal size class.

    Declaration

    Objective-C

    - (void)setToolbarItems:(nullable NSArray<UIBarButtonItem *> *)toolbarItems
               forSizeClass:(UIUserInterfaceSizeClass)sizeClass
                   animated:(BOOL)animated;

    Swift

    func setToolbarItems(_ toolbarItems: [UIBarButtonItem]?, for sizeClass: UIUserInterfaceSizeClass, animated: Bool)

    Parameters

    toolbarItems

    the toolbar items to use

    sizeClass

    the horizontal user interface size class

    animated

    whether to animate the change

  • The items currently shown by the moreItemsViewController in a list-style interface for the current trait collection.

    The getter for this property returns -moreItemsForSizeClass: for the current horizontal user inteface size class, and the setter uses -setMoreItems:forSizeClass: to set the items for all user interface size classes.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *moreItems;

    Swift

    var moreItems: [UIBarButtonItem]? { get set }
  • Returns the moreItems shown by the moreItemsViewController for the given horizontal user interface size class.

    Declaration

    Objective-C

    - (nullable NSArray<UIBarButtonItem *> *)moreItemsForSizeClass:
        (UIUserInterfaceSizeClass)sizeClass;

    Swift

    func moreItems(for sizeClass: UIUserInterfaceSizeClass) -> [UIBarButtonItem]?

    Parameters

    sizeClass

    the horizontal user interface size class for which to get the list of items

    Return Value

    the items shown by the moreItemsViewController for the given horizontal user interface size class

  • Sets the moreItems shown by the moreItemsViewController for the given horizontal user interface size class.

    Declaration

    Objective-C

    - (void)setMoreItems:(nullable NSArray<UIBarButtonItem *> *)moreItems
            forSizeClass:(UIUserInterfaceSizeClass)sizeClass;

    Swift

    func setMoreItems(_ moreItems: [UIBarButtonItem]?, for sizeClass: UIUserInterfaceSizeClass)

    Parameters

    moreItems

    the items to show

    sizeClass

    the horizontal user interface size class

  • The items currently shown by the moreItemsViewController.

    The getter for this property returns -moreItemsForSizeClass: for the current horizontal user inteface size class, and the setter uses -setMoreItems:forSizeClass: to set the items for all user interface size classes.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *exportItems;

    Swift

    var exportItems: [UIBarButtonItem]? { get set }
  • The UIActivityViewController used to present action and sharing activities for the current document.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIActivityViewController *activityViewController;

    Swift

    var activityViewController: UIActivityViewController? { get set }
  • The navigation lists view controller managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTNavigationListsViewController *_Nonnull navigationListsViewController;

    Swift

    var navigationListsViewController: PTNavigationListsViewController { get set }
  • Whether the navigation lists view controller is always shown as a modal presentation. When set to NO, the view controller is shown as a docked panel on iPads when there is sufficient horizontal space. The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL alwaysShowNavigationListsAsModal;

    Swift

    var alwaysShowNavigationListsAsModal: Bool { get set }
  • Declaration

    Objective-C

    - (void)showNavigationLists;

    Swift

    func showNavigationLists()
  • The PTThumbnailsViewController view controller managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTThumbnailsViewController *_Nonnull thumbnailsViewController;

    Swift

    var thumbnailsViewController: PTThumbnailsViewController { get set }
  • Hides any presented view controllers and shows the thumbnailsViewController.

    Declaration

    Objective-C

    - (void)showThumbnailsController;

    Swift

    func showThumbnailsController()
  • The PTTextSearchViewController managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTTextSearchViewController *_Nonnull textSearchViewController;

    Swift

    var textSearchViewController: PTTextSearchViewController { get set }
  • Hides any presented view controllers and shows the textSearchViewController.

    Declaration

    Objective-C

    - (void)showSearchViewController;

    Swift

    func showSearch()
  • The PTPageCropViewController view controller managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTPageCropViewController *_Nonnull pageCropViewController;

    Swift

    var pageCropViewController: PTPageCropViewController { get set }
  • Shows a dialog to select a page crop mode option.

    Declaration

    Objective-C

    - (void)showPageCropOptions:(id _Nullable)sender;

    Swift

    func showPageCropOptions(_ sender: Any?)
  • Hides any presented view controllers and shows the pageCropViewController.

    Declaration

    Objective-C

    - (void)showPageCropViewController;

    Swift

    func showPageCropViewController()
  • The PTThumbnailSliderViewController managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTThumbnailSliderViewController *_Nonnull thumbnailSliderController;

    Swift

    var thumbnailSliderController: PTThumbnailSliderViewController { get set }
  • The PTPageIndicatorViewController managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTPageIndicatorViewController *_Nonnull pageIndicatorViewController;

    Swift

    var pageIndicatorViewController: PTPageIndicatorViewController { get set }
  • The PTDocumentViewSettingsController managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTDocumentViewSettingsController *_Nonnull settingsViewController;

    Swift

    var settingsViewController: PTDocumentViewSettingsController { get set }
  • The PTReflowViewController managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTReflowViewController *_Nonnull reflowViewController;

    Swift

    var reflowViewController: PTReflowViewController { get set }
  • The PTMoreItemsViewController managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTMoreItemsViewController *_Nonnull moreItemsViewController;

    Swift

    var moreItemsViewController: PTMoreItemsViewController { get set }
  • Shows the moreItemsViewController in a popover presentation.

    Declaration

    Objective-C

    - (void)showMoreItems:(nonnull id)sender;

    Swift

    func showMoreItems(_ sender: Any)
  • The PTAddPagesViewController managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTAddPagesViewController *_Nonnull addPagesViewController;

    Swift

    var addPagesViewController: PTAddPagesViewController { get set }
  • Shows the settingsViewController in a popover presentation from the specified UIBarButtonItem.

    Declaration

    Objective-C

    - (void)showSettings:(nonnull id)sender;

    Swift

    func showSettings(_ sender: Any)

    Parameters

    sender

    the object (usually a UIBarButtonItem or UIView) on which to anchor the popover.

  • Shows the settingsViewController in a popover presentation from the specified screen rect.

    Declaration

    Objective-C

    - (void)showSettingsFromScreenRect:(CGRect)screenRect;

    Swift

    func showSettings(fromScreenRect screenRect: CGRect)

    Parameters

    screenRect

    the rectangle in which to anchor the popover.

  • Shows the addPagesViewController in a popover presentation from the specified UIBarButtonItem.

    Declaration

    Objective-C

    - (void)showAddPagesView:(nonnull id)sender;

    Swift

    func showAddPagesView(_ sender: Any)

    Parameters

    sender

    the object (usually a UIBarButtonItem or UIView) on which to anchor the popover.

  • Shows the addPagesViewController in a popover presentation from the specified screen rect.

    Declaration

    Objective-C

    - (void)showAddPagesViewFromScreenRect:(CGRect)screenRect;

    Swift

    func showAddPagesView(fromScreenRect screenRect: CGRect)

    Parameters

    screenRect

    the rectangle in which to anchor the popover.

  • Creates an activity alert with the given title

    Declaration

    Objective-C

    - (nonnull UIViewController *)createActivityAlertWithTitle:
        (nonnull NSString *)title;

    Swift

    func createActivityAlert(withTitle title: String) -> UIViewController

    Parameters

    title

    the text to be displayed on the alert

  • Called when shareButtonItem is tapped

    Declaration

    Objective-C

    - (void)showShareActions:(nonnull UIBarButtonItem *)barButtonItem;

    Swift

    func showShareActions(_ barButtonItem: UIBarButtonItem)
  • Shares a copy of the document in a UIActivityViewController.

    Declaration

    Objective-C

    - (void)shareCopy:(nonnull id)sender withFlattening:(BOOL)flattening;

    Swift

    func shareCopy(_ sender: Any, withFlattening flattening: Bool)

    Parameters

    sender

    the object (usually a UIBarButtonItem or UIView) on which to anchor the popover.

    flattening

    whether annotations in the document should be flattened before sharing.

  • Shares a copy of the document in a UIActivityViewController.

    Declaration

    Objective-C

    - (void)shareCopy:(nonnull id)sender
        withFlattening:(BOOL)flattening
        targetFileName:(nullable NSString *)targetFileName;

    Swift

    func shareCopy(_ sender: Any, withFlattening flattening: Bool, targetFileName: String?)

    Parameters

    sender

    the object (usually a UIBarButtonItem or UIView) on which to anchor the popover.

    flattening

    whether annotations in the document should be flattened before sharing.

    targetFileName

    The file name of the exported document without extension.

  • Shares a copy of the document in a UIActivityViewController.

    Declaration

    Objective-C

    - (void)shareCopy:(nonnull id)sender
           withFlattening:(BOOL)flattening
        completionHandler:(nullable void (^)(BOOL))completionHandler;

    Swift

    func shareCopy(_ sender: Any, withFlattening flattening: Bool) async -> Bool

    Parameters

    sender

    the object (usually a UIBarButtonItem or UIView) on which to anchor the popover.

    flattening

    whether annotations in the document should be flattened before sharing.

  • Shares a copy of the document in a UIActivityViewController.

    Declaration

    Objective-C

    - (void)shareCopy:(nonnull id)sender
           withFlattening:(BOOL)flattening
           targetFileName:(nullable NSString *)targetFileName
        completionHandler:(nullable void (^)(BOOL))completionHandler;

    Swift

    func shareCopy(_ sender: Any, withFlattening flattening: Bool, targetFileName: String?) async -> Bool

    Parameters

    sender

    the object (usually a UIBarButtonItem or UIView) on which to anchor the popover.

    flattening

    whether annotations in the document should be flattened before sharing.

    targetFileName

    The file name of the exported document without extension.

  • Shares a copy of the document in a UIActivityViewController.

    Declaration

    Objective-C

    - (void)shareCopyFromScreenRect:(CGRect)screenRect
                     withFlattening:(BOOL)flattening;

    Swift

    func shareCopy(fromScreenRect screenRect: CGRect, withFlattening flattening: Bool)

    Parameters

    screenRect

    the rectangle in which to anchor the popover.

    flattening

    whether annotations in the document should be flattened before sharing.

  • Shares a copy of the document in a UIActivityViewController.

    Declaration

    Objective-C

    - (void)shareDocument:(nonnull PTPDFDoc *)pdfDoc
                     with:(nullable NSURL *)url
                     from:(nonnull id)sender
             requiresSave:(BOOL)requiresSave;

    Swift

    func shareDocument(_ pdfDoc: PTPDFDoc, with url: URL?, from sender: Any, requiresSave: Bool)

    Parameters

    pdfDoc

    the PTPDFDoc to share.

    url

    the file URL of the document.

    sender

    the object (usually a UIBarButtonItem or UIView) on which to anchor the popover.

    requiresSave

    whether the document needs to be saved before sharing.

  • The PTCustomTableViewController managed by this view controller for showing export options.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTCustomTableViewController *_Nonnull exportTableViewController;

    Swift

    var exportTableViewController: PTCustomTableViewController { get set }
  • Whether the controls are toggled in response to an otherwise unhandled tap.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL hidesControlsOnTap;

    Swift

    var hidesControlsOnTap: Bool { get set }
  • Whether the isNavigationBarHidden property of this view controller’s containing UINavigationController is controlled by this view controller.

    When enabled, this view controller will update the UINavigationController.isNavigationBarHidden property as part of its bar-hiding (and -showing) behavior. Otherwise, this view controller will not update the isNavigationBarHidden property and it is the responsibility of users of this class to ensure that the bars are consistent with the desired behavior and appearance.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL hidesNavigationBar;

    Swift

    var hidesNavigationBar: Bool { get set }
  • Whether the isToolbarHidden property of this view controller’s UINavigationController is controlled by this view controller.

    When enabled, this view controller will update the UINavigationController.isToolbarHidden property as part of its bar-hiding (and -showing) behavior. Otherwise, this view controller will not update the isToolbarHidden property and it is the responsibility of users of this class to ensure that the bars are consistent with the desired behavior and appearance.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL hidesBottomBar;

    Swift

    var hidesBottomBar: Bool { get set }
  • Whether the navigation bar, toolbars, and other controls are hidden. When hiding or showing controls, the hidesNavigationBar and hidesBottomBar properties are respected.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL controlsHidden;

    Swift

    var controlsHidden: Bool { get set }
  • Sets whether the controls are hidden.

    For animated transitions, the duration of the animation is specified by the value in the UINavigationControllerHideShowBarDuration constant.

    Declaration

    Objective-C

    - (void)setControlsHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setControlsHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    Specify YES to hide the controls or NO to show them

    animated

    Specify YES if you want to animate the change in visibility or NO if you want the controls to appear immediately.

  • Whether the find text toolbar is hidden. The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isSearchViewControllerHidden) BOOL searchViewControllerHidden;

    Swift

    var isSearchViewControllerHidden: Bool { get set }
  • Whether the thumbnail slider control is hidden. The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isThumbnailSliderHidden) BOOL thumbnailSliderHidden;

    Swift

    var isThumbnailSliderHidden: Bool { get set }
  • Sets whether the thumbnail slider control is hidden.

    For animated transitions, the duration of the animation is specified by the value in the UINavigationControllerHideShowBarDuration constant.

    Declaration

    Objective-C

    - (void)setThumbnailSliderHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setThumbnailSliderHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    Specify YES to hide the thumbnail slider or NO to show it

    animated

    Specify YES if you want to animate the change in visibility or NO if you want the control to appear immediately

  • Whether the page indicator control is hidden. The default value is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isPageIndicatorHidden) BOOL pageIndicatorHidden;

    Swift

    var isPageIndicatorHidden: Bool { get set }
  • Sets whether the page indicator control is hidden.

    Declaration

    Objective-C

    - (void)setPageIndicatorHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setPageIndicatorHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    Specify YES to hide the page indicator or NO to show it.

    animated

    Specify YES if you want to animate the change in visibility or NO if you want the control to appear immediately.

  • Whether the reflow control is hidden. The default value is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isReflowHidden) BOOL reflowHidden;

    Swift

    var isReflowHidden: Bool { get set }
  • Controls the visibility of the activity indicator i.e progress spinner while loading the document.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL hidesProgressSpinner;

    Swift

    var hidesProgressSpinner: Bool { get set }
  • Whether the controls are hidden automatically after a period of time. The default value is NO.

    The automaticControlHidingDelay is used to specify the time delay.

    Declaration

    Objective-C

    @property (nonatomic) BOOL automaticallyHidesControls;

    Swift

    var automaticallyHidesControls: Bool { get set }
  • Whether the controls are hidden automatically after a period of time. The default value is NO.

    The automaticControlHidingDelay is used to specify the time delay.

    Declaration

    Objective-C

    @property (nonatomic) BOOL automaticallyHideToolbars;

    Swift

    var automaticallyHideToolbars: Bool { get set }
  • The number of seconds to wait before automatically hiding the controls. The default value is PTDocumentViewControllerHideControlsInterval.

    Declaration

    Objective-C

    @property (nonatomic) NSTimeInterval automaticControlHidingDelay;

    Swift

    var automaticControlHidingDelay: TimeInterval { get set }
  • Restart the automatic control hiding timer with the delay specified in the automaticControlHidingDelay property.

    Declaration

    Objective-C

    - (void)restartAutomaticControlHidingTimer;

    Swift

    func restartAutomaticControlHidingTimer()
  • Restart the automatic control hiding timer with the specified delay.

    The automaticControlHidingDelay property is updated with the specified delay.

    Declaration

    Objective-C

    - (void)restartAutomaticControlHidingTimerWithDelay:(NSTimeInterval)delay;

    Swift

    func restartAutomaticControlHidingTimer(withDelay delay: TimeInterval)

    Parameters

    delay

    The delay to use for automatic control hiding.

  • Stop the automatic control hiding timer.

    Declaration

    Objective-C

    - (void)stopAutomaticControlHidingTimer;

    Swift

    func stopAutomaticControlHidingTimer()
  • Whether the controls should be hidden in response to the given timer firing.

    The default implementation of this method returns the value of the automaticallyHideToolbars property.

    Declaration

    Objective-C

    - (BOOL)shouldHideControlsFromTimer:(nonnull NSTimer *)timer;

    Swift

    func shouldHideControls(from timer: Timer) -> Bool
  • Returns an object initialized from data in a given unarchiver.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCoder:(nonnull NSCoder *)coder;

    Swift

    init(coder: NSCoder)
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE;
  • Whether view state persistence is enabled.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isViewStatePersistenceEnabled)
        BOOL viewStatePersistenceEnabled;

    Swift

    var isViewStatePersistenceEnabled: Bool { get set }
  • The string used to identify the saved view state for a document among other metadata.

    The default value of this property is a Tools-specific identifier string.

    Declaration

    Objective-C

    @property (class, nonatomic, copy, null_resettable) NSString *savedViewStateIdentifier;

    Swift

    class var savedViewStateIdentifier: String! { get set }
  • Saves the document’s current view state.

    Note

    In Swift, this method is imported as a throwing function.

    Declaration

    Objective-C

    - (BOOL)saveCurrentViewStateForDocumentWithError:
        (NSError *_Nullable *_Nullable)error;

    Swift

    func saveCurrentViewStateForDocument() throws

    Parameters

    error

    On input, a pointer to an error object. If an error occurs , this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

    Return Value

    YES if the view state was saved, NO otherwise if an error occurred

  • Restores the document’s saved view state.

    Note

    In Swift, this method is imported as a throwing function.

    Declaration

    Objective-C

    - (BOOL)restoreCurrentViewStateForDocumentWithError:
        (NSError *_Nullable *_Nullable)error;

    Swift

    func restoreCurrentViewStateForDocument() throws

    Parameters

    error

    On input, a pointer to an error object. If an error occurs , this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

    Return Value

    YES if the view state was restored, NO otherwise if an error occurred

  • This method is called when a document has been successfully opened in this view controller.

    Declaration

    Objective-C

    - (void)didOpenDocument;

    Swift

    func didOpenDocument()
  • This method is called when a document could not be opened in this view controller.

    Declaration

    Objective-C

    - (void)handleDocumentOpeningFailureWithError:(nullable NSError *)error;

    Swift

    func handleDocumentOpeningFailureWithError(_ error: (any Error)?)

    Parameters

    error

    The error object describing the failure. May be nil if information regarding the failure was not available

  • This method is called when the view controller enters an invalid state.

    In response, the document could be re-opened or this view controller could be closed or dismissed.

    Declaration

    Objective-C

    - (void)didBecomeInvalid;

    Swift

    func didBecomeInvalid()
  • This method is called before the specified document is saved.

    Declaration

    Objective-C

    - (void)willSaveDocument:(nonnull PTPDFDoc *)pdfDoc;

    Swift

    func willSaveDocument(_ pdfDoc: PTPDFDoc)

    Parameters

    pdfDoc

    The PDF document that will be saved.

  • This method is called after the specified document is saved successfully.

    Declaration

    Objective-C

    - (void)didSaveDocument:(nonnull PTPDFDoc *)pdfDoc;

    Swift

    func didSaveDocument(_ pdfDoc: PTPDFDoc)

    Parameters

    pdfDoc

    The PDF document that was saved.

  • This method is called if there was an error while saving the specified document.

    Declaration

    Objective-C

    - (void)didFailSavingDocument:(nonnull PTPDFDoc *)pdfDoc
                        withError:(nonnull NSError *)error;

    Swift

    func didFailSavingDocument(_ pdfDoc: PTPDFDoc, withError error: any Error)

    Parameters

    pdfDoc

    The PDF document that could not be saved.

    error

    The error that occurred while saving the document.

  • This method is called when the panel is opened.

    Declaration

    Objective-C

    - (void)didShowLeadingPanelViewController:
        (nonnull UIViewController *)viewController;

    Swift

    func didShowLeadingPanelViewController(_ viewController: UIViewController)
  • This method is called when the panel is closed.

    Declaration

    Objective-C

    - (void)didDismissLeadingPanelViewController:
        (nonnull UIViewController *)viewController;

    Swift

    func didDismissLeadingPanelViewController(_ viewController: UIViewController)
  • Returns whether the cached document at the given temporary URL should be exported to a different permanent location. The temporary URL does not point to a user-visible location and if the cached document is not exported it may be deleted by the system at any time.

    The default implementation of this method returns YES.

    Declaration

    Objective-C

    - (BOOL)shouldExportCachedDocumentAtURL:(nonnull NSURL *)cachedDocumentURL;

    Swift

    func shouldExportCachedDocument(at cachedDocumentURL: URL) -> Bool

    Parameters

    cachedDocumentURL

    the temporary URL of the cached document

    Return Value

    YES if the cached document should be exported, NO otherwise.

  • Returns the destination URL for the document at the given source URL location. If nil is returned from this method, the document will be copied to the user-visible Documents directory inside the containing app’s sandbox.

    The default implementation of this method returns nil.

    Declaration

    Objective-C

    - (nullable NSURL *)destinationURLforDocumentAtURL:(nonnull NSURL *)sourceURL;

    Swift

    func destinationURLforDocument(at sourceURL: URL) -> URL?

    Parameters

    sourceURL

    The source URL of the document

    Return Value

    the destination URL for the document

  • Returns whether the cached document at the given URL should be deleted. If the cached document has been exported to a different location, as indicated by the -shouldExportCachedDocumentAtURL: and -destinationURLforDocumentAtURL: methods, the original copy of the document can be deleted by returning YES for this method.

    If it is desired that HTTP(S) documents should not be re-downloaded unless necessary (ie. unless the remote file has changed since it was last downloaded), then the cached document should not be deleted.

    The default implementation of this method returns NO.

    Declaration

    Objective-C

    - (BOOL)shouldDeleteCachedDocumentAtURL:(nonnull NSURL *)cachedDocumentURL;

    Swift

    func shouldDeleteCachedDocument(at cachedDocumentURL: URL) -> Bool

    Parameters

    cachedDocumentURL

    The URL of the cached document

  • Returns whether the controls should be hidden in response to a timer (if the automaticallyHidesControls property is enabled) or user tap (if the hidesControlsOnTap property is enabled).

    The default implementation of this method returns YES if this view controller is not currently presenting another view controller and does not have another modal-type control active.

    Declaration

    Objective-C

    - (BOOL)shouldHideControls;

    Swift

    func shouldHideControls() -> Bool

    Return Value

    YES if the view controller’s controls should be hidden, NO otherwise

  • Returns whether the view controller’s controls should be shown in response to a user tap (if the hidesControlsOnTap property is enabled).

    The default implementation of this method return YES if this view controller’s containing UINavigationController currently has its navigation bar hidden and no other view controllers are currently presented.

    Declaration

    Objective-C

    - (BOOL)shouldShowControls;

    Swift

    func shouldShowControls() -> Bool

    Return Value

    YES if the view controller’s controls should be shown, NO otherwise.

  • Called when the hidden state of the controls has actually been changed.

    Declaration

    Objective-C

    - (void)didSetControlsHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func didSetControlsHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    The new hidden state of the controls

    animated

    Whether the change was animated

  • Returns whether the text search view controller should be dismissed when the view controller’s view disappears.

    The default implementation of this method returns YES.

    Declaration

    Objective-C

    - (BOOL)shouldAutomaticallyDismissSearchViewController;

    Swift

    func shouldAutomaticallyDismissSearch() -> Bool

    Return Value

    YES if the view controller’s controls should be hidden, NO otherwise