PSPDFConfiguration
@interface PSPDFConfiguration
: PSPDFBaseConfiguration <PSPDFConfigurationBuilder *>
<PSPDFOverridable> @end
A PSPDFConfiguration
defines the behavior of a PSPDFViewController
.
It uses the builder pattern via PSPDFConfigurationBuilder
to create an immutable copy via a block.
-
Set a page mode defined in the enum. Defaults to
PSPDFPageModeAutomatic
. Reloads the view, unless it is set while rotation is active. Thus, one can customize the size change behavior by setting this within a size transition animation block. Ignored whenpageTransition
is set toPSPDFPageTransitionScrollContinuous
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFPageMode pageMode;
Swift
var pageMode: PSPDFPageMode { get }
-
Defines the page transition. Defaults to
PSPDFPageTransitionScrollPerSpread
.Warning
If you change the property dynamically inviewWillTransitionToSize:withTransitionCoordinator:
, wait for the transition to finish using the coordinator’s completion block, otherwise the controller will get in an invalid state. Child view controllers get rotation events AFTER the parent view controller, so if you’re changing this from a parent viewController, for PSPDFKit the rotation hasn’t been completed yet, and your app will eventually crash. In that case, use a[PSPDFDispatchQueue.mainQueue async:^{ ... }];
to set. You might just want to setupdateSettingsForBoundsChangeBlock
and set your properties there.Note
, we enable theautomaticallyAdjustsScrollViewInsets
by default. If you don’t want this behavior, subclassreloadData
and set this property to NO.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFPageTransition pageTransition;
Swift
var pageTransition: PSPDFPageTransition { get }
-
Shows first document page alone. Defaults to YES.
Declaration
Objective-C
@property (readonly, getter=isFirstPageAlwaysSingle, nonatomic) BOOL firstPageAlwaysSingle;
Swift
var isFirstPageAlwaysSingle: Bool { get }
-
Controls whether spreads can grow larger than the actual view.
This can be helpful on smaller screens to make the content more readable.
Note
This property has no effect if the page transition is anything butPSPDFPageTransitionScrollPerSpread
orPSPDFPageTransitionScrollContinuous
.Defaults to
PSPDFConfigurationSpreadFittingAdaptive
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFConfigurationSpreadFitting spreadFitting;
Swift
var spreadFitting: PSPDFConfigurationSpreadFitting { get }
-
Only useful for
PSPDFPageTransitionCurl
. Clips the page to its boundaries, not showing a pageCurl on empty background. Defaults to YES. Set to NO if your document is variably sized.Declaration
Objective-C
@property (readonly, nonatomic) BOOL clipToPageBoundaries;
Swift
var clipToPageBoundaries: Bool { get }
-
Additional insets to apply to the document scroll view’s frame.
See
-[PSPDFDocumentViewLayout additionalScrollViewFrameInsets]
Declaration
Objective-C
@property (readonly, nonatomic) UIEdgeInsets additionalScrollViewFrameInsets;
Swift
var additionalScrollViewFrameInsets: UIEdgeInsets { get }
-
Additional insets to apply to the layout’s content.
Note
This only has an effect if the page transition is either
PSPDFPageTransitionScrollPerSpread
orPSPDFPageTransitionScrollContinuous
.See
-[PSPDFStackViewLayout additionalContentInsets]
Declaration
Objective-C
@property (readonly, nonatomic) UIEdgeInsets additionalContentInsets;
Swift
var additionalContentInsets: UIEdgeInsets { get }
-
Enable/disable page shadow. Defaults to NO.
Declaration
Objective-C
@property (readonly, getter=isShadowEnabled, nonatomic) BOOL shadowEnabled;
Swift
var isShadowEnabled: Bool { get }
-
Set default shadowOpacity. Defaults to 0.7.
Declaration
Objective-C
@property (readonly, nonatomic) CGFloat shadowOpacity;
Swift
var shadowOpacity: CGFloat { get }
-
Background color behind the page view. Defaults to a dynamic color on iOS 13 and above which matches the current
UIUserInterfaceStyle
. Falls back to dark gray color on versions prior iOS 13.Declaration
Objective-C
@property (readonly, nonatomic) UIColor *_Nonnull backgroundColor;
Swift
var backgroundColor: UIColor { get }
-
Allowed appearance modes for
PSPDFBrightnessViewController
. Defaults toPSPDFAppearanceModeAll
.PSPDFAppearanceModeDefault
is always assumed to be available. Set to onlyPSPDFAppearanceModeDefault
to disable appearance mode picker UI. This needs to be set beforePSPDFBrightnessViewController
is presented.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFAppearanceMode allowedAppearanceModes;
Swift
var allowedAppearanceModes: PSPDFAppearanceMode { get }
-
Page scrolling direction. Defaults to
PSPDFScrollDirectionHorizontal
. Only relevant for scrolling page transitions.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFScrollDirection scrollDirection;
Swift
var scrollDirection: PSPDFScrollDirection { get }
-
Sets the scroll view inset adjustment mode. Defaults to
PSPDFScrollInsetAdjustmentFixedElements
. This is only evaluated forPSPDFPageTransitionScrollContinuous
&PSPDFScrollDirectionVertical
.Note
This is similar toautomaticallyAdjustsScrollViewInsets
but more tailored to PSPDFKit’s use case.Warning
UIViewController
’sautomaticallyAdjustsScrollViewInsets
will always be disabled. Don’t enable this property.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFScrollInsetAdjustment scrollViewInsetAdjustment;
Swift
var scrollViewInsetAdjustment: PSPDFScrollInsetAdjustment { get }
-
Minimum zoom scale. Defaults to 1.
Declaration
Objective-C
@property (readonly, nonatomic) float minimumZoomScale;
Swift
var minimumZoomScale: Float { get }
-
Maximum zoom scale for the scrollview. Defaults to 20.
Declaration
Objective-C
@property (readonly, nonatomic) float maximumZoomScale;
Swift
var maximumZoomScale: Float { get }
-
Determines whether the scrolling is locked in a certain direction when interacting with the document’s pages.
The default value of this property is
PSPDFAdaptiveConditionalAdaptive
, which means the directional lock on the underlying scroll view will be enabled or disabled depending on the context in which the document is being presented. Setting explicitYES
orNO
values will directly affect how the scroll view behaves, regardless of presentation context.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFAdaptiveConditional documentViewLayoutDirectionalLock;
Swift
var documentViewLayoutDirectionalLock: PSPDFAdaptiveConditional { get }
-
If YES, shows an
UIActivityIndicatorView
on the top right while page is rendering. Defaults to YES.Declaration
Objective-C
@property (readonly, getter=isRenderAnimationEnabled, nonatomic) BOOL renderAnimationEnabled;
Swift
var isRenderAnimationEnabled: Bool { get }
-
Position of render status view. Defaults to
PSPDFRenderStatusViewPositionTop
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFRenderStatusViewPosition renderStatusViewPosition;
Swift
var renderStatusViewPosition: PSPDFRenderStatusViewPosition { get }
-
The action that happens when the user double taps somewhere in the document. Defaults to
PSPDFTapActionSmartZoom
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFTapAction doubleTapAction;
Swift
var doubleTapAction: PSPDFTapAction { get }
-
If set to YES, automatically focuses on selected form elements. Defaults to NO.
Declaration
Objective-C
@property (readonly, getter=isFormElementZoomEnabled, nonatomic) BOOL formElementZoomEnabled;
Swift
var isFormElementZoomEnabled: Bool { get }
-
Whether tapping on leading/trailing edges of the document view should trigger changing to the previous/next page. Defaults to YES.
Taps detected near the edge cancel the double-tap to zoom gesture so the default margin is quite narrow. This gesture allows fast tapping to quickly browse through a document.
Declaration
Objective-C
@property (readonly, getter=isScrollOnEdgeTapEnabled, nonatomic) BOOL scrollOnEdgeTapEnabled;
Swift
var isScrollOnEdgeTapEnabled: Bool { get }
-
Whether to animate scrolling to the previous or next page when tapping the edges of the view. Defaults to NO to enable very fast browsing through a document.
This is only effective if
scrollOnEdgeTapEnabled
is set to YES.Note
This property has no effect if you are usingPSPDFPageTransitionCurl
.Declaration
Objective-C
@property (readonly, getter=animateScrollOnEdgeTaps, nonatomic) BOOL animateScrollOnEdgeTaps;
Swift
var animateScrollOnEdgeTaps: Bool { get }
-
The margin in points from the view’s sides in which tapping should trigger scrolling to the previous/next page. Defaults to 44.
This is only effective if
scrollOnEdgeTapEnabled
is set to YES.Note
This property has no effect if you are usingPSPDFPageTransitionCurl
.Declaration
Objective-C
@property (readonly, nonatomic) CGFloat scrollOnEdgeTapMargin;
Swift
var scrollOnEdgeTapMargin: CGFloat { get }
-
Set the default link action for pressing on
PSPDFLinkAnnotation
s. Default isPSPDFLinkActionOpenSafari
.Note
If modal is set in the link, this property has no effect.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFLinkAction linkAction;
Swift
var linkAction: PSPDFLinkAction { get }
-
May be used to customize other displayed menu actions when text is selected. Defaults to
PSPDFTextSelectionMenuActionSearch|PSPDFTextSelectionMenuActionDefine|PSPDFTextSelectionMenuActionSpeak|PSPDFTextSelectionMenuActionShare|PSPDFTextSelectionMenuActionCopy|PSPDFTextSelectionMenuActionAnnotationCreation
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFTextSelectionMenuAction allowedMenuActions;
Swift
var allowedMenuActions: PSPDFTextSelectionMenuAction { get }
-
Allows text selection. Defaults to YES.
Note
Requires thePSPDFFeatureMaskTextSelection
feature flag. This implies that the PDF file actually contains text glyphs. Sometimes text is represented via embedded images or vectors, in that case PSPDFKit can’t select it.Declaration
Objective-C
@property (readonly, getter=isTextSelectionEnabled, nonatomic) BOOL textSelectionEnabled;
Swift
var isTextSelectionEnabled: Bool { get }
-
Allows image selection. Defaults to YES.
Note
Requires thePSPDFFeatureMaskTextSelection
feature flag. This implies that the image is not in vector format. Only supports a subset of all possible image types in PDF.Warning
Will only work iftextSelectionEnabled
is also set to YES.Declaration
Objective-C
@property (readonly, getter=isImageSelectionEnabled, nonatomic) BOOL imageSelectionEnabled;
Swift
var isImageSelectionEnabled: Bool { get }
-
Defines how the text is selected.
Defaults to
PSPDFTextSelectionModeRegular
on iOS andPSPDFTextSelectionModeSimple
on Mac Catalyst.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFTextSelectionMode textSelectionMode;
Swift
var textSelectionMode: PSPDFTextSelectionMode { get }
-
Specifies whether the selection view snaps to word boundaries when selecting text.
Setting this to
YES
will:- adjust the text selection to word boundaries when resize handles are released,
- ensure selection starts on a word boundary in
PSPDFTextSelectionModeSimple
on Mac Catalyst.
A new selection always first selects a full word in
PSPDFTextSelectionModeRegular
. That’s also the case on iOS, regardless of the set selection mode.Defaults
NO
.Declaration
Objective-C
@property (readonly, nonatomic) BOOL textSelectionShouldSnapToWord;
Swift
var textSelectionShouldSnapToWord: Bool { get }
-
Modify what annotations are editable and can be created. Set to nil to completely disable annotation editing/creation. Defaults to all available annotation strings.
Warning
Some annotation types are only behaviorally different in PSPDFKit but are mapped to basic annotation types, so adding those will only change the creation of those types, not editing. Example: If you addPSPDFAnnotationStringInk
but notPSPDFAnnotationStringSignature
, signatures added in previous session will still be editable (since they are Ink annotations). On the other hand, if you setPSPDFAnnotationStringSignature
but notPSPDFAnnotationStringInk
, then your newly created signatures will not be movable. SeePSPDFAnnotation.h
for additional comments.Declaration
Objective-C
@property (readonly, nonatomic) NSSet<PSPDFAnnotationString> *_Nonnull editableAnnotationTypes;
Swift
var editableAnnotationTypes: Set<AnnotationString> { get }
-
Shows a custom cell with configurable color presets for the provided annotation types. Defaults to
PSPDFAnnotationTypeAll
. Set toPSPDFAnnotationTypeNone
to completely disable color presets.Note
The presets are only displayed if the PSPDFStyleManager returns supported annotation types only.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFAnnotationType typesShowingColorPresets;
Swift
var typesShowingColorPresets: AnnotationType { get }
-
Customize the inspector items globally.
This currently affects
PSPDFAnnotationStyleViewController
andPSPDFFreeTextAccessoryView
.The dictionary is keyed by annotation type (
PSPDFAnnotationString
). The values are either:- an array of arrays of property name strings (see
PSPDFAnnotationStyleKeyGroupedList
) - a block taking an annotation and returning
PSPDFAnnotationStyleKeyGroupedList
for it (seePSPDFAnnotationStyleBlock
)
See
PSPDFAnnotationStyleKey
for a list of supported keys.The block option is especially useful to customize the available inspector properties based on some annotation attributes. (e.g., show callout options based on the free text annotation intentType).
Note
If you want to disable all color editing, be sure to also remove the relevant type fromtypesShowingColorPresets
(also available inPSPDFConfiguration
).Declaration
Objective-C
@property (readonly, nonatomic) NSDictionary<PSPDFAnnotationString, id> *_Nonnull propertiesForAnnotations;
Swift
var propertiesForAnnotations: [AnnotationString : Any] { get }
- an array of arrays of property name strings (see
-
Shows a toolbar with text editing options (
PSPDFFreeTextAccessoryView
) above the keyboard, while editing free text annotations. Defaults to YES. You need to set this property before the text annotation is edited.Declaration
Objective-C
@property (readonly, getter=isFreeTextAccessoryViewEnabled, nonatomic) BOOL freeTextAccessoryViewEnabled;
Swift
var isFreeTextAccessoryViewEnabled: Bool { get }
-
Controls how bookmarks are displayed and managed. While bookmarks have a custom order, the default is set to
PSPDFBookmarkManagerSortOrderPageBased
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFBookmarkManagerSortOrder bookmarkSortOrder;
Swift
var bookmarkSortOrder: PSPDFBookmarkManagerSortOrder { get }
-
Sets the page’s bookmark indicator mode. Defaults to
PSPDFPageBookmarkIndicatorModeOff
. Depending on this mode, a button indicating the current bookmark status of the page will be displayed on the page itself. Tapping the button will toggle the bookmark mode. For customising the bookmark indicator, see PSPDFBookMarkIndicatorButton.hSee
bookmarkIndicatorInteractionEnabledDeclaration
Objective-C
@property (readonly, nonatomic) PSPDFPageBookmarkIndicatorMode bookmarkIndicatorMode;
Swift
var bookmarkIndicatorMode: PSPDFPageBookmarkIndicatorMode { get }
-
Enables/disables the bookmark indicator’s interaction. Defaults to
YES
. If this is enabled, tapping the indicator will bookmark on unbookmark the page it is displayed on. Use this in conjunction withbookmarkIndicatorMode
to get the desired behaviourSee
bookmarkIndicatorModeDeclaration
Objective-C
@property (readonly, nonatomic) BOOL bookmarkIndicatorInteractionEnabled;
Swift
var bookmarkIndicatorInteractionEnabled: Bool { get }
-
Defines whether it is possible to add multiple bookmarks on the same page via the UI. If this is enabled:
- the bookmark list’s add button is always enabled.
- the bookmark button item removes all bookmarks on a page, if there are any, if tapped.
This property does not affect adding bookmarks via the bookmark manager, where adding multiple ones for a single page is always supported.
Defaults to NO.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL allowMultipleBookmarksPerPage;
Swift
var allowMultipleBookmarksPerPage: Bool { get }
-
Manages the show/hide mode of the user interface view. Defaults to
PSPDFUserInterfaceViewModeAutomaticNoFirstLastPage
.Note
The user interface view consists of the thumbnail view at the bottom and the page/document label. The visibility of the navigation bar of the parent navigation controller can be linked to the user interface via enablingshouldHideNavigationBarWithUserInterface
.Warning
The user interface view will not change when changing this mode after controller is visible. UsesetUserInterfaceVisible:animated:
instead. Does not affect manual calls tosetUserInterfaceVisible
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFUserInterfaceViewMode userInterfaceViewMode;
Swift
var userInterfaceViewMode: PSPDFUserInterfaceViewMode { get }
-
Sets the way the user interface view will be animated. Defaults to
PSPDFUserInterfaceViewAnimationFade
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFUserInterfaceViewAnimation userInterfaceViewAnimation;
Swift
var userInterfaceViewAnimation: PSPDFUserInterfaceViewAnimation { get }
-
Changes the user interface style for the contents when displayed inside a half-modal or a popover. Defaults to
PSPDFPresentationHalfModalStyleCard
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFPresentationHalfModalStyle halfModalStyle;
Swift
var halfModalStyle: PSPDFPresentationHalfModalStyle { get }
-
Enables/Disables the bottom document site position overlay. Defaults to YES. Animatable. Will be added to the userInterfaceView.
Declaration
Objective-C
@property (readonly, getter=isPageLabelEnabled, nonatomic) BOOL pageLabelEnabled;
Swift
var isPageLabelEnabled: Bool { get }
-
Enable/disable the top document label overlay. Defaults to
PSPDFAdaptiveConditionalAdaptive
- the document label is shown if there’s not enough space to set the navigation bar title instead.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFAdaptiveConditional documentLabelEnabled;
Swift
var documentLabelEnabled: PSPDFAdaptiveConditional { get }
-
Automatically hides the user interface when the user starts scrolling to different pages in the document. Defaults to YES.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldHideUserInterfaceOnPageChange;
Swift
var shouldHideUserInterfaceOnPageChange: Bool { get }
-
Should show the user interface view on
viewWillAppear:
, unless the user interface is disabled. Defaults to YES.Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldShowUserInterfaceOnViewWillAppear;
Swift
var shouldShowUserInterfaceOnViewWillAppear: Bool { get }
-
If the home indicator height should be included when calculating the insets for the document view. Defaults to NO.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldAdjustDocumentInsetsByIncludingHomeIndicatorSafeAreaInsets;
Swift
var shouldAdjustDocumentInsetsByIncludingHomeIndicatorSafeAreaInsets: Bool { get }
-
Controls whether a
PSPDFViewController
should show a page grabber on the edge of the screen to enable the user to quickly skim through the pages of a document.Defaults to
NO
.Declaration
Objective-C
@property (readonly, getter=isPageGrabberEnabled, nonatomic) BOOL pageGrabberEnabled;
Swift
var isPageGrabberEnabled: Bool { get }
-
Allow PSPDFKit to change the title of this view controller. If
YES
, the controller title will be set to the document title ornil
, depending on whether the document label is visible or not. Set toNO
, to manage the viewController title manually.Defaults to YES.
On Mac Catalyst, we suggest to not show a toolbar and set
allowWindowTitleChange
instead.Declaration
Objective-C
@property (readonly, nonatomic) BOOL allowToolbarTitleChange;
Swift
var allowToolbarTitleChange: Bool { get }
-
Mac Catalyst specific: Sets the documentURL and title of the current window. This uses NSDocumentController internally to set the toolbar and set the dirty state.
This method has no effect on iOS. Defaults to NO.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL allowWindowTitleChange;
Swift
var allowWindowTitleChange: Bool { get }
-
If YES, the navigation bar will be hidden when the user interface is hidden. If NO, the navigation will stay shown or hidden depending on the value of
[UINavigationController navigationBarHidden]
. Defaults to YES.Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldHideNavigationBarWithUserInterface;
Swift
var shouldHideNavigationBarWithUserInterface: Bool { get }
-
If YES, the status bar will always remain hidden (regardless of the
shouldHideStatusBarWithUserInterface
setting). The setting is also passed on to internally created sub-controllers. Defaults to NO.Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldHideStatusBar;
Swift
var shouldHideStatusBar: Bool { get }
-
If YES, the status bar will be hidden when the user interface is hidden. Defaults to YES.
Note
Needs to be set before the view is loaded.Note
This setting is ignored when the navigation bar is always visible (shouldHideNavigationBarWithUserInterface
and[UINavigationController navigationBarHidden]
both set toNO
).Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldHideStatusBarWithUserInterface;
Swift
var shouldHideStatusBarWithUserInterface: Bool { get }
-
Defines if the floating redaction info button, that is shown when there are uncommitted redactions in the document, should be shown in the user interface view.
Defaults to
YES
, if the Redaction component is included in the license.Note
Setting this property will have no effect if the Redaction component is not included in the license.
Note
When disabling this and you support redaction annotations, applying redactions will need to be handled manually.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldShowRedactionInfoButton;
Swift
var shouldShowRedactionInfoButton: Bool { get }
-
Whether the usage hint alert should be shown the first time the user selects the redaction tool.
Defaults to
YES
, if the Redaction component is included in the license.Note
Setting this property will have no effect if the Redaction component is not included in the license.Declaration
Objective-C
@property (readonly, nonatomic) BOOL redactionUsageHintEnabled;
Swift
var redactionUsageHintEnabled: Bool { get }
-
Shows a floating back button in the lower part of the screen. Used to navigate back to the origin page when navigating via PDF actions. Defaults to
YES
.Declaration
Objective-C
@property (readonly, nonatomic) BOOL showBackActionButton;
Swift
var showBackActionButton: Bool { get }
-
Shows a floating forward button in the lower part of the screen. Used to revert the back button navigation action. Defaults to
YES
.Declaration
Objective-C
@property (readonly, nonatomic) BOOL showForwardActionButton;
Swift
var showForwardActionButton: Bool { get }
-
Adds text labels representing the destination name to the back and forward buttons. Defaults to
YES
on iPad andNO
otherwise.Declaration
Objective-C
@property (readonly, nonatomic) BOOL showBackForwardActionButtonLabels;
Swift
var showBackForwardActionButtonLabels: Bool { get }
-
Sets the thumbnail bar mode. Defaults to
PSPDFThumbnailBarModeFloatingScrubberBar
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFThumbnailBarMode thumbnailBarMode;
Swift
var thumbnailBarMode: PSPDFThumbnailBarMode { get }
-
Controls the placement of the scrubber bar. Defaults to
PSPDFScrubberBarTypeHorizontal
.Note
CustomizingscrubberBarType
is supported only whenthumbnailBarMode
isPSPDFThumbnailBarModeScrubberBar
. Otherwise, setting this property to any value other thanPSPDFScrubberBarTypeHorizontal
won’t have any effect.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFScrubberBarType scrubberBarType;
Swift
var scrubberBarType: PSPDFScrubberBarType { get }
-
If YES, the thumbnail bar will not be shown for single page documents. Defaults to YES.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL hideThumbnailBarForSinglePageDocuments;
Swift
var hideThumbnailBarForSinglePageDocuments: Bool { get }
-
Controls the thumbnail grouping. Defaults to
PSPDFThumbnailGroupingAutomatic
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFThumbnailGrouping thumbnailGrouping;
Swift
var thumbnailGrouping: PSPDFThumbnailGrouping { get }
-
The thumbnail size for
PSPDFThumbnailViewController
. Defaults toCGSizeZero
. If one of the width or height is zero, this dimension will be determined from the page aspect ratio. If both the width and height are zero, the size is automatic and adaptive, based on the page sizes and view size.Declaration
Objective-C
@property (readonly, nonatomic) CGSize thumbnailSize;
Swift
var thumbnailSize: CGSize { get }
-
The minimum internal horizontal space between thumbnails in
PSPDFThumbnailViewController
. The default depends on the screen size, and is the same asthumbnailLineSpacing
and each element inthumbnailMargin
.Declaration
Objective-C
@property (readonly, nonatomic) CGFloat thumbnailInteritemSpacing;
Swift
var thumbnailInteritemSpacing: CGFloat { get }
-
The minimum internal vertical space between thumbnails in
PSPDFThumbnailViewController
. The default depends on the screen size, and is the same asthumbnailInteritemSpacing
and each element inthumbnailMargin
.Declaration
Objective-C
@property (readonly, nonatomic) CGFloat thumbnailLineSpacing;
Swift
var thumbnailLineSpacing: CGFloat { get }
-
The external margin around the grid of thumbnails in thumbnail view mode. The default depends on the screen size, with all elements the same as
thumbnailInteritemSpacing
andthumbnailLineSpacing
.Declaration
Objective-C
@property (readonly, nonatomic) UIEdgeInsets thumbnailMargin;
Swift
var thumbnailMargin: UIEdgeInsets { get }
-
Overlay annotations are faded in. Set global duration for this fade here. Defaults to 0.25.
Declaration
Objective-C
@property (readonly, nonatomic) CGFloat annotationAnimationDuration;
Swift
var annotationAnimationDuration: CGFloat { get }
-
If set to YES, you can group/ungroup annotations with the multi-select tool. Defaults to YES.
Note
This is a UI setting that defines ifgroup
onPSPDFAnnotation
is evaluated or not. Thegroup
property is always set for group operations.Declaration
Objective-C
@property (readonly, nonatomic) BOOL annotationGroupingEnabled;
Swift
var annotationGroupingEnabled: Bool { get }
-
Controls if markup annotations should be merged.
Defaults to
PSPDFMarkupAnnotationMergeIfColorMatches
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFMarkupAnnotationMergeBehavior markupAnnotationMergeBehavior;
Swift
var markupAnnotationMergeBehavior: PSPDFMarkupAnnotationMergeBehavior { get }
-
If set to YES, a long-tap that ends on a page area that is not a text/image will show a new menu to create annotations. Defaults to YES. If set to NO, there’s no menu displayed and the loupe is simply hidden. Menu can be intercepted and customized with the
shouldShowMenuItems:atSuggestedTargetRect:forAnnotation:inRect:onPageView:
delegate. (when annotation is nil)Note
Requires thePSPDFFeatureMaskAnnotationEditing
feature flag.Declaration
Objective-C
@property (readonly, getter=isCreateAnnotationMenuEnabled, nonatomic) BOOL createAnnotationMenuEnabled;
Swift
var isCreateAnnotationMenuEnabled: Bool { get }
-
Types allowed in the create annotations menu. Defaults to the most common annotation types. (strings) Contains a list of
PSPDFAnnotationGroup
andPSPDFAnnotationGroupItem
items.Note
There is no visual separation for different groups. Types that are not listed ineditableAnnotationTypes
will be ignored.Declaration
Objective-C
@property (readonly, copy, nonatomic) NSArray<PSPDFAnnotationGroup *> *_Nonnull createAnnotationMenuGroups;
Swift
var createAnnotationMenuGroups: [PSPDFAnnotationGroup] { get }
-
Enables natural drawing for ink annotations. Defaults to
NO
.Declaration
Objective-C
@property (readonly, nonatomic) BOOL naturalDrawingAnnotationEnabled;
Swift
var naturalDrawingAnnotationEnabled: Bool { get }
-
The confidence threshold at which the magic ink tool should replace the drawn ink with a corresponding shape annotation. This should always be in the range [0, 100], with 100 representing a perfect match.
Defaults to 70.
Declaration
Objective-C
@property (readonly, nonatomic) NSUInteger magicInkReplacementThreshold;
Swift
var magicInkReplacementThreshold: UInt { get }
-
Defines how ink annotations are created.
The PDF spec allows an unlimited number of separate paths per ink annotation object. They all need to have the same color and width.
Defaults to
PSPDFDrawCreateModeAutomatic
.Note
This does not affect undo - undo is smart and tracks paths individually.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFDrawCreateMode drawCreateMode;
Swift
var drawCreateMode: PSPDFDrawCreateMode { get }
-
If YES, the annotation menu will be displayed after an annotation has been created. Defaults to NO.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL showAnnotationMenuAfterCreation;
Swift
var showAnnotationMenuAfterCreation: Bool { get }
-
If YES, asks the user to specify a custom annotation username (
author
) when first creating a new annotationThis is triggered by the
PSPDFAnnotationStateManager
changing its state.A default name will already be suggested based on the device name. You can change the default username by setting
-[PSPDFDocument defaultAnnotationUsername]
. Defaults to YES.Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldAskForAnnotationUsername;
Swift
var shouldAskForAnnotationUsername: Bool { get }
-
Controls if a second tap to an annotation that allows inline editing enters edit mode. Defaults to YES. (The most probable candidate for this is
PSPDFFreeTextAnnotation
)Declaration
Objective-C
@property (readonly, nonatomic) BOOL annotationEntersEditModeAfterSecondTapEnabled;
Swift
var annotationEntersEditModeAfterSecondTapEnabled: Bool { get }
-
Scrolls to affected page during an undo/redo operation. Defaults to YES.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldScrollToChangedPage;
Swift
var shouldScrollToChangedPage: Bool { get }
-
Controls the sound annotation player style. Defaults to
PSPDFSoundAnnotationPlayerStyleBottom
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFSoundAnnotationPlayerStyle soundAnnotationPlayerStyle;
Swift
var soundAnnotationPlayerStyle: PSPDFSoundAnnotationPlayerStyle { get }
-
Controls if PSPDFKit should save at specific points, like when the app enters background or when the view controller disappears. Defaults to YES. Implement
PSPDFDocumentDelegate
to be notified of those saving actions.Declaration
Objective-C
@property (readonly, getter=isAutosaveEnabled, nonatomic) BOOL autosaveEnabled;
Swift
var isAutosaveEnabled: Bool { get }
-
The save method will be invoked when the view controller is dismissed. This increases controller dismissal if enabled.
Note
Make sure that you don’t re-create thePSPDFDocument
object if you enable background saving, else you might run into race conditions where the old object is still saving and the new one might load outdated/corrupted data. Defaults to NO.Declaration
Objective-C
@property (readonly, nonatomic) BOOL allowBackgroundSaving;
Swift
var allowBackgroundSaving: Bool { get }
-
Describes the time limit for recording sound annotations in seconds. After this time has been reached, the recording will stop.
Defaults to 300 (= 5 minutes).
Declaration
Objective-C
@property (readonly, nonatomic) NSTimeInterval soundAnnotationTimeLimit;
Swift
var soundAnnotationTimeLimit: TimeInterval { get }
-
Defines the default options when a sound annotation is created for recording.
Defaults to an empty dictionary in which case following set is used:
AVFormatIDKey: @(kAudioFormatLinearPCM) AVSampleRateKey: @(annotation.rate) // 22050 AVNumberOfChannelsKey: @(annotation.channels) // 1 AVLinearPCMBitDepthKey: @(annotation.bits) // 16
Make sure to set a combination that are supported in
- AVAudioRecorder
- AVPlayer
The PDF Specification
See
PDF Reference 1.7, Chapter 13.3 Sounds and
PSPDFSoundAnnotation
for details.Declaration
Objective-C
@property (readonly, nonatomic) NSDictionary<NSString *, id> *_Nonnull soundAnnotationRecordingOptions;
Swift
var soundAnnotationRecordingOptions: [String : Any] { get }
-
Controls whether to display search results directly in a PDF, or as a list in a modal. Defaults to
PSPDFSearchModeModal
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFSearchMode searchMode;
Swift
var searchMode: PSPDFSearchMode { get }
-
If a search result is selected, we scroll to the page to make it visible. Defaults to
PSPDFAutomaticSearchResultZoomScale
to indicate automatic scale based on the result we’re zooming into.If this is set to 1, no zooming is performed. Increase this to zoom to the search result. This value will be clamped by
maximumZoomScale
and should be set below. Values smaller than 1 and other thanPSPDFAutomaticSearchResultZoomScale
will be clamped to 1 as well.Note
This value will be used as a guidance. In case the zoom would be too large, we reduce the scale to ensure the object fits the screen.Declaration
Objective-C
@property (readonly, nonatomic) CGFloat searchResultZoomScale;
Swift
var searchResultZoomScale: CGFloat { get }
-
Defines if a signature should be saved after creation. Defaults to
PSPDFSignatureSavingStrategySaveIfSelected
. Shows an action sheet when done creating a signature inPSPDFSignatureViewController
, when set toPSPDFSignatureSavingStrategySaveIfSelected
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFSignatureSavingStrategy signatureSavingStrategy;
Swift
var signatureSavingStrategy: PSPDFSignatureSavingStrategy { get }
-
Defines if the user should be able to select certificates for digitally signing a document, when creating a new signature. Defaults to
PSPDFSignatureCertificateSelectionModeIfAvailable
.Will always show the certificate button on the signature creation UI, when set to
PSPDFSignatureCertificateSelectionModeAlways
. Will never show the certificate button on the signature creation UI, when set toPSPDFSignatureCertificateSelectionModeNever
. Will only show the certificate button on the signature creation UI, when there areregisteredSigners
on the sharedPSPDFSignatureManager
, when set toPSPDFSignatureCertificateSelectionModeIfAvailable
. This is the default mode.Note
Needs to have Digital Signatures licensed, will be ignored otherwise.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFSignatureCertificateSelectionMode signatureCertificateSelectionMode;
Swift
var signatureCertificateSelectionMode: PSPDFSignatureCertificateSelectionMode { get }
-
Defines which biometric properties,
PSPDFSignatureBiometricProperties
, should be stored in a digital signature, if one is created. Defaults toPSPDFSignatureBiometricPropertiesOptionAll
.Note
Needs to have Digital Signatures licensed, will be ignored otherwise.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFSignatureBiometricPropertiesOption signatureBiometricPropertiesOptions;
Swift
var signatureBiometricPropertiesOptions: PSPDFSignatureBiometricPropertiesOption { get }
-
Enables natural drawing for signatures. Defaults to YES.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL naturalSignatureDrawingEnabled;
Swift
var naturalSignatureDrawingEnabled: Bool { get }
-
The default signature store implementation. Defaults to
PSPDFKeychainSignatureStore
.Declaration
Objective-C
@property (readonly, nonatomic) id<PSPDFSignatureStore> _Nonnull signatureStore;
-
A list of configurations to use when sharing documents.
Includes a configuration for sharing to
UIActivityViewController
by default.Declaration
Objective-C
@property (readonly, nonatomic) NSArray<PSPDFDocumentSharingConfiguration *> *_Nonnull sharingConfigurations;
Swift
var sharingConfigurations: [PSPDFDocumentSharingConfiguration] { get }
-
The default sharing destination to be selected when presenting the sharing UI. If not set, the first configuration is chosen.
Declaration
Objective-C
@property (readonly, nonatomic, nullable) PSPDFDocumentSharingDestination selectedSharingDestination;
Swift
var selectedSharingDestination: PSPDFDocumentSharingDestination? { get }
-
Options that will be presented by
PSPDFSettingsViewController
. Defaults toPSPDFSettingsOptionDefault
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFSettingsOptions settingsOptions;
Swift
var settingsOptions: PSPDFSettingsOptions { get }
-
Enable/Disable all internal gesture recognizers. Defaults to YES. Can be useful if you’re doing custom drawing on the
PSPDFPageView
.Declaration
Objective-C
@property (readonly, nonatomic) BOOL internalTapGesturesEnabled;
Swift
var internalTapGesturesEnabled: Bool { get }
-
Set this to true to allow this controller to access the parent
navigationBar
/navigationController
to add custom buttons. Has no effect if there’s noparentViewController
. Defaults to NO.Note
When using this feature, you should also implement bothchildViewControllerForStatusBarHidden
andchildViewControllerForStatusBarStyle
to return thePSPDFViewController
instance that is embedded.Declaration
Objective-C
@property (readonly, nonatomic) BOOL useParentNavigationBar;
Swift
var useParentNavigationBar: Bool { get }
-
If enabled, will request that all thumbnails are pre-cached in
viewDidAppear:
. Defaults to NO. Set this to YES if you want to precache thumbnails if you use the thumbnail view mode a lot.Warning
Does not delete any cache and doesn’t change if set after the controller has been presented.Declaration
Objective-C
@property (readonly, nonatomic) BOOL shouldCacheThumbnails;
Swift
var shouldCacheThumbnails: Bool { get }
-
Determines if it should be supported to change the z-index of annotations in the UI.
If enabled, this will show a section in the annotation inspector to move an annotation. Also shows reorder controls in
PSPDFAnnotationTableViewController
if changing the z-index is allowed.There are more factors, in addition to this property, that are considered, when determining if an annotation can be moved.
Defaults to YES.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL allowAnnotationZIndexMoves;
Swift
var allowAnnotationZIndexMoves: Bool { get }
-
Configure whether the user should be presented with the option to remove digital signatures from PDF documents.
Note
This property will beYES
only ifPSPDFAnnotationStringSignature
is included inPSPDFConfiguration.editableAnnotationTypes
.Declaration
Objective-C
@property (readonly, nonatomic) BOOL allowRemovingDigitalSignatures;
Swift
var allowRemovingDigitalSignatures: Bool { get }
-
The configuration used for the gallery system. Defaults to
PSPDFGalleryConfiguration.defaultConfiguration
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFGalleryConfiguration *_Nonnull galleryConfiguration;
Swift
var galleryConfiguration: PSPDFGalleryConfiguration { get }
-
Configures how and where Drag and Drop should work. Defaults to
PSPDFDragAndDropConfiguration.defaultConfiguration
.Declaration
Objective-C
@property (readonly, nonatomic) PSPDFDragAndDropConfiguration *_Nonnull dragAndDropConfiguration;
Swift
var dragAndDropConfiguration: PSPDFDragAndDropConfiguration { get }
-
A configuration set up with appropriate settings for image display.
Declaration
Objective-C
@property (readonly, nonatomic, class) PSPDFConfiguration *_Nonnull imageConfiguration;
Swift
class var image: PSPDFConfiguration { get }
-
Configuration options for various document editor controllers.
Declaration
Objective-C
@property (readonly, nonatomic) PSPDFDocumentEditorConfiguration *_Nonnull documentEditorConfiguration;
Swift
var documentEditorConfiguration: PSPDFDocumentEditorConfiguration { get }