PSPDFConfiguration
Objective-C
@interface PSPDFConfiguration
: PSPDFBaseConfiguration <PSPDFConfigurationBuilder *> <PSPDFOverridable>
Swift
class PDFConfiguration : BaseConfiguration<PDFConfigurationBuilder>, Overridable
A PDFConfiguration
defines the behavior of a PDFViewController
.
It uses the builder pattern via PDFConfigurationBuilder
to create an immutable copy via a block.
-
Set a page mode defined in the enum. Defaults to
.automatic
. 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 to.scrollContinuous
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFPageMode pageMode;
Swift
var pageMode: PageMode { get }
-
Defines the page transition. Defaults to
.scrollPerSpread
.Warning
If you change the property dynamically in
viewWillTransitionToSize: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, dispatch the work async on the main queue. You might just want to setupdateSettingsForBoundsChangeBlock
and set your properties there.Note
We enable the
automaticallyAdjustsScrollViewInsets
by default. If you don’t want this behavior, subclassreloadData
and set this property tofalse
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFPageTransition pageTransition;
Swift
var pageTransition: PageTransition { get }
-
Shows first document page alone as “cover mode”. Defaults to
true
.Declaration
Objective-C
@property (nonatomic, readonly, getter=isFirstPageAlwaysSingle) BOOL firstPageAlwaysSingle;
Swift
var isFirstPageAlwaysSingle: Bool { get }
-
Controls whether spreads can grow larger than the actual view. Defaults to
.adaptive
. 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 butPageTransition.scrollPerSpread
orPageTransition.scrollContinuous
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFConfigurationSpreadFitting spreadFitting;
Swift
var spreadFitting: PDFConfiguration.SpreadFitting { get }
-
Only useful for
PageTransition.curl
. Clips the page to its boundaries, not showing a pageCurl on empty background. Defaults totrue
. Set tofalse
if your document is variably sized.Declaration
Objective-C
@property (nonatomic, readonly) 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 (nonatomic, readonly) 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
.scrollPerSpread
or.scrollContinuous
.Declaration
Objective-C
@property (nonatomic, readonly) UIEdgeInsets additionalContentInsets;
Swift
var additionalContentInsets: UIEdgeInsets { get }
-
Enable/disable page shadow. Defaults to
false
.Declaration
Objective-C
@property (nonatomic, readonly, getter=isShadowEnabled) BOOL shadowEnabled;
Swift
var isShadowEnabled: Bool { get }
-
Set default shadowOpacity. Defaults to 0.7.
Declaration
Objective-C
@property (nonatomic, readonly) CGFloat shadowOpacity;
Swift
var shadowOpacity: CGFloat { get }
-
Background color behind the page view. Defaults to a dynamic color which matches the current
UIUserInterfaceStyle
.Declaration
Objective-C
@property (nonatomic, readonly) UIColor *_Nonnull backgroundColor;
Swift
var backgroundColor: UIColor { get }
-
Allowed appearance modes for
BrightnessViewController
. Defaults to.all
..default
is always assumed to be available. Set to only.default
to disable appearance mode picker UI. This needs to be set beforeBrightnessViewController
is presented.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFAppearanceMode allowedAppearanceModes;
Swift
var allowedAppearanceModes: PDFAppearanceMode { get }
-
Page scrolling direction. Defaults to
.horizontal
. Only relevant for scrolling page transitions.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFScrollDirection scrollDirection;
Swift
var scrollDirection: ScrollDirection { get }
-
Deprecated
Deprecated in PSPDFKit 11.5 for iOS. Using this property has no effect.
Sets the scroll view inset adjustment mode. Defaults to
ScrollInsetAdjustment.fixedElements
. This is only evaluated forPageTransition.scrollContinuous
&ScrollDirection.vertical
.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 (nonatomic, readonly) PSPDFScrollInsetAdjustment scrollViewInsetAdjustment;
Swift
var scrollViewInsetAdjustment: ScrollInsetAdjustment { get }
-
Minimum zoom scale. Defaults to 1.
Declaration
Objective-C
@property (nonatomic, readonly) float minimumZoomScale;
Swift
var minimumZoomScale: Float { get }
-
Maximum zoom scale for the scrollview. Defaults to 20.
Declaration
Objective-C
@property (nonatomic, readonly) 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
.adaptive
, 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 explicittrue
orfalse
values will directly affect how the scroll view behaves, regardless of presentation context.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFAdaptiveConditional documentViewLayoutDirectionalLock;
Swift
var documentViewLayoutDirectionalLock: AdaptiveConditional { get }
-
If
true
, shows anUIActivityIndicatorView
on the top right while page is rendering. Defaults totrue
.Declaration
Objective-C
@property (nonatomic, readonly, getter=isRenderAnimationEnabled) BOOL renderAnimationEnabled;
Swift
var isRenderAnimationEnabled: Bool { get }
-
Position of render status view. Defaults to
.top
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFRenderStatusViewPosition renderStatusViewPosition;
Swift
var renderStatusViewPosition: RenderStatusViewPosition { get }
-
The action that happens when the user double taps somewhere in the document. Defaults to
.smartZoom
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFTapAction doubleTapAction;
Swift
var doubleTapAction: TapAction { get }
-
If set to
true
, automatically focuses on selected form elements. Defaults tofalse
.Declaration
Objective-C
@property (nonatomic, readonly, getter=isFormElementZoomEnabled) 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
true
.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 (nonatomic, readonly, getter=isScrollOnEdgeTapEnabled) 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
false
to enable very fast browsing through a document.This is only effective if
scrollOnEdgeTapEnabled
is set totrue
.Note
This property has no effect if you are usingPageTransition.curl
.Declaration
Objective-C
@property (nonatomic, readonly, getter=animateScrollOnEdgeTaps) 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 totrue
.Note
This property has no effect if you are usingPageTransition.curl
.Declaration
Objective-C
@property (nonatomic, readonly) CGFloat scrollOnEdgeTapMargin;
Swift
var scrollOnEdgeTapMargin: CGFloat { get }
-
Set the default link action for pressing on
LinkAnnotation
s. Default is.openSafari
.Note
If modal is set in the link, this property has no effect.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFLinkAction linkAction;
Swift
var linkAction: LinkAction { get }
-
May be used to customize other displayed menu actions when text is selected. Defaults to
[.search, .define, .speak, .share, .copy, .annotationCreation]
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFTextSelectionMenuAction allowedMenuActions;
Swift
var allowedMenuActions: TextSelectionMenuAction { get }
-
Allows text selection. Defaults to
true
.Note
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 (nonatomic, readonly, getter=isTextSelectionEnabled) BOOL textSelectionEnabled;
Swift
var isTextSelectionEnabled: Bool { get }
-
Allows image selection. Defaults to
true
.Note
This implies that the image is not in vector format. Only supports a subset of all possible image types in PDF.Declaration
Objective-C
@property (nonatomic, readonly, getter=isImageSelectionEnabled) BOOL imageSelectionEnabled;
Swift
var isImageSelectionEnabled: Bool { get }
-
Defines how the text is selected. Defaults to
.automatic
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFTextSelectionMode textSelectionMode;
Swift
var textSelectionMode: TextSelectionMode { get }
-
Specifies whether the selection view snaps to word boundaries when selecting text.
Setting this to
true
will:- adjust the text selection to word boundaries when resize handles are released,
- ensure selection starts on a word boundary in
.simple
on Mac Catalyst.
A new selection always first selects a full word in
.regular
. That’s also the case on iOS, regardless of the set selection mode.Defaults
false
.Declaration
Objective-C
@property (nonatomic, readonly) 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.
In the case of
.widget
, whether that type is included ineditableAnnotationTypes
determines whether users can interact with PDF forms to edit form field values rather than editing the form elements themselves. In other words, editing the properties like background color or the position of form elements on the page is not supported.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 add
.ink
but not.signature
, signatures added in previous session will still be editable (since they are ink annotations). On the other hand, if you set.signature
but not.ink
, then your newly created signatures will not be movable.See
PSPDFAnnotation.h
for additional comments.Declaration
Objective-C
@property (nonatomic, readonly) NSSet<PSPDFAnnotationString> *_Nonnull editableAnnotationTypes;
Swift
var editableAnnotationTypes: Set<Annotation.Tool> { 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 (nonatomic, readonly) PSPDFAnnotationType typesShowingColorPresets;
Swift
var typesShowingColorPresets: Annotation.Kind { get }
-
Customize the inspector items globally.
This currently affects
AnnotationStyleViewController
andFreeTextAccessoryView
.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
AnnotationStyle.Key
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 inPDFConfiguration
).Declaration
Objective-C
@property (nonatomic, readonly) NSDictionary<PSPDFAnnotationString, id> *_Nonnull propertiesForAnnotations;
Swift
var propertiesForAnnotations: [Annotation.Tool : Any] { get }
- an array of arrays of property name strings (see
-
Shows a toolbar with text editing options (
FreeTextAccessoryView
) above the keyboard, while editing free text annotations. Defaults totrue
. You need to set this property before the text annotation is edited.Declaration
Objective-C
@property (nonatomic, readonly, getter=isFreeTextAccessoryViewEnabled) 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
BookmarkManager.sortOrderPageBased
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFBookmarkManagerSortOrder bookmarkSortOrder;
Swift
var bookmarkSortOrder: BookmarkManager.SortOrder { get }
-
Sets the page’s bookmark indicator mode. Defaults to
.off
. 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 customizing the bookmark indicator, see PSPDFBookMarkIndicatorButton.hSee
bookmarkIndicatorInteractionEnabledDeclaration
Objective-C
@property (nonatomic, readonly) PSPDFPageBookmarkIndicatorMode bookmarkIndicatorMode;
Swift
var bookmarkIndicatorMode: PageBookmarkIndicatorMode { get }
-
Enables/disables the bookmark indicator’s interaction. Defaults to
true
. If this is enabled, tapping the indicator will bookmark on un-bookmark the page it is displayed on. Use this in conjunction withbookmarkIndicatorMode
to get the desired behaviorSee
bookmarkIndicatorModeDeclaration
Objective-C
@property (nonatomic, readonly) 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
false
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL allowMultipleBookmarksPerPage;
Swift
var allowMultipleBookmarksPerPage: Bool { get }
-
Controls the behavior of the user interface view, defaults to
.automaticNoFirstLastPage
.PDFViewController
can display additional information and interactive elements for the visible document as an overlay called the user interface view. While the elements in the user interface view are controlled by various other configuration properties,userInterfaceViewMode
controls the initial visibility of the user interface view and whether the visibility is updated on user interaction.For immersive reading, the visibility of the navigation bar of the parent navigation controller can be tied to the user interface view by setting
shouldHideNavigationBarWithUserInterface
totrue
, except inUserInterfaceViewMode.never
. In this mode, the visibility of the navigation bar is left untouched to prevent getting “trapped” inside aPDFViewController
due to the lack of the back- or close button typically present in the navigation bar.Note
Explicit, manual calls to
setUserInterfaceVisible(_:animated:)
on aPDFViewController
always take precedence over the value of this property.Warning
The visibility of the user interface view is not updated when changing this mode once a
PDFViewController
is on screen! To programmatically show/hide the user interface view, usesetUserInterfaceVisible(_:animated:)
instead.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFUserInterfaceViewMode userInterfaceViewMode;
Swift
var userInterfaceViewMode: UserInterfaceViewMode { get }
-
Sets the way the user interface view will be animated. Defaults to
.fade
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFUserInterfaceViewAnimation userInterfaceViewAnimation;
Swift
var userInterfaceViewAnimation: UserInterfaceViewAnimation { get }
-
Changes the user interface style for the contents when displayed inside a half-modal or a popover. Defaults to
.card
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFPresentationHalfModalStyle halfModalStyle;
Swift
var halfModalStyle: PresentationHalfModalStyle { get }
-
Declaration
Objective-C
@property (nonatomic, readonly, getter=isPageLabelEnabled) BOOL pageLabelEnabled;
Swift
var isPageLabelEnabled: Bool { get }
-
Enable/disable the top document label overlay. Defaults to
.adaptive
: The document label is shown if there’s not enough space to set the navigation bar title instead.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFAdaptiveConditional documentLabelEnabled;
Swift
var documentLabelEnabled: AdaptiveConditional { get }
-
Automatically hides the user interface when the user starts scrolling to different pages in the document. Defaults to
true
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL shouldHideUserInterfaceOnPageChange;
Swift
var shouldHideUserInterfaceOnPageChange: Bool { get }
-
Should show the user interface view on
viewWillAppear:
, unless the user interface is disabled. Defaults totrue
.Declaration
Objective-C
@property (nonatomic, readonly) 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
false
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL shouldAdjustDocumentInsetsByIncludingHomeIndicatorSafeAreaInsets;
Swift
var shouldAdjustDocumentInsetsByIncludingHomeIndicatorSafeAreaInsets: Bool { get }
-
Allow PSPDFKit to change the title of this view controller. If
true
, the controller title will be set to the document title ornil
, depending on whether the document label is visible or not. Set tofalse
, to manage the viewController title manually.Defaults to
true
.On Mac Catalyst, we suggest to not show a toolbar and set
allowWindowTitleChange
instead.Declaration
Objective-C
@property (nonatomic, readonly) 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
false
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL allowWindowTitleChange;
Swift
var allowWindowTitleChange: Bool { get }
-
If
true
, the navigation bar will be hidden when the user interface is hidden. Iffalse
, the navigation will stay shown or hidden depending on the value of[UINavigationController navigationBarHidden]
. Defaults totrue
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL shouldHideNavigationBarWithUserInterface;
Swift
var shouldHideNavigationBarWithUserInterface: Bool { get }
-
If
true
, the status bar will always remain hidden (regardless of theshouldHideStatusBarWithUserInterface
setting). The setting is also passed on to internally created sub-controllers. Defaults tofalse
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL shouldHideStatusBar;
Swift
var shouldHideStatusBar: Bool { get }
-
If
true
, the status bar will be hidden when the user interface is hidden. Defaults totrue
.Note
This setting is ignored when the navigation bar is always visible (shouldHideNavigationBarWithUserInterface
andUINavigationController.isNavigationBarHidden
both set tofalse
).Declaration
Objective-C
@property (nonatomic, readonly) 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
true
, 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 (nonatomic, readonly) 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
true
, 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 (nonatomic, readonly) 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
true
.Declaration
Objective-C
@property (nonatomic, readonly) 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
true
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL showForwardActionButton;
Swift
var showForwardActionButton: Bool { get }
-
Adds text labels representing the destination name to the back and forward buttons. Defaults to
true
on iPad andfalse
otherwise.Declaration
Objective-C
@property (nonatomic, readonly) BOOL showBackForwardActionButtonLabels;
Swift
var showBackForwardActionButtonLabels: Bool { get }
-
Sets the thumbnail bar mode. Defaults to
.floatingScrubberBar
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFThumbnailBarMode thumbnailBarMode;
Swift
var thumbnailBarMode: ThumbnailBarMode { get }
-
Controls the placement of the scrubber bar. Defaults to
.horizontal
.Note
CustomizingscrubberBarType
is supported only whenthumbnailBarMode
is.scrubberBar
. Otherwise, setting this property to any value other than.horizontal
won’t have any effect.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFScrubberBarType scrubberBarType;
Swift
var scrubberBarType: ScrubberBarType { get }
-
If
true
, the thumbnail bar will not be shown for single page documents. Defaults totrue
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL hideThumbnailBarForSinglePageDocuments;
Swift
var hideThumbnailBarForSinglePageDocuments: Bool { get }
-
Controls the thumbnail grouping. Defaults to
.automatic
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFThumbnailGrouping thumbnailGrouping;
Swift
var thumbnailGrouping: ThumbnailGrouping { get }
-
The thumbnail size for
ThumbnailViewController
andPDFDocumentEditorViewController
. 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 (nonatomic, readonly) CGSize thumbnailSize;
Swift
var thumbnailSize: CGSize { get }
-
The minimum internal horizontal space between thumbnails in
ThumbnailViewController
. The default depends on the screen size, and is the same asthumbnailLineSpacing
and each element inthumbnailMargin
.Declaration
Objective-C
@property (nonatomic, readonly) CGFloat thumbnailInteritemSpacing;
Swift
var thumbnailInteritemSpacing: CGFloat { get }
-
The minimum internal vertical space between thumbnails in
ThumbnailViewController
. The default depends on the screen size, and is the same asthumbnailInteritemSpacing
and each element inthumbnailMargin
.Declaration
Objective-C
@property (nonatomic, readonly) 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 (nonatomic, readonly) 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 (nonatomic, readonly) CGFloat annotationAnimationDuration;
Swift
var annotationAnimationDuration: CGFloat { get }
-
If set to
true
, you can group/ungroup annotations with the multi-select tool. Defaults totrue
.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 (nonatomic, readonly) BOOL annotationGroupingEnabled;
Swift
var annotationGroupingEnabled: Bool { get }
-
Controls if markup annotations should be merged. Defaults to
.ifColorMatches
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFMarkupAnnotationMergeBehavior markupAnnotationMergeBehavior;
Swift
var markupAnnotationMergeBehavior: MarkupAnnotationMergeBehavior { get }
-
If
true
, a long press or secondary click on an empty space of a page view will present a menu to create new annotations. Iffalse
, this behavior is disabled.If enabled, the annotation creation menu can be customized using the
createAnnotationMenuGroups
configuration property or using thePSPDFViewControllerDelegate/pdfViewController:menuForCreatingAnnotationAtPoint:onPageView:appearance:suggestedMenu:
delegate method.Note
Presenting the annotation creation menu requires the Annotation Editing component to be enabled for your license.Declaration
Objective-C
@property (nonatomic, readonly, getter=isCreateAnnotationMenuEnabled) BOOL createAnnotationMenuEnabled;
Swift
var isCreateAnnotationMenuEnabled: Bool { get }
-
The array of annotation type groups shown in the annotation creation menu. Annotation types that are not listed in
editableAnnotationTypes
will be ignored.On iOS 16 and newer, annotation type groups will be separated from each other when the annotation creation menu is presented using secondary click interaction. Otherwise, there’s no visual separation between the groups.
Setting this property to an empty array doesn’t prevent the annotation creation menu from being presented, as it may also contain other actions, such as Paste. To disable the annotation creation menu completely, set the
createAnnotationMenuEnabled
configuration property tofalse
.Note
Presenting the annotation creation menu requires the Annotation Editing component to be enabled for your license.Declaration
Objective-C
@property (nonatomic, copy, readonly) NSArray<PSPDFAnnotationGroup *> *_Nonnull createAnnotationMenuGroups;
Swift
var createAnnotationMenuGroups: [PSPDFAnnotationGroup] { get }
-
Enables natural drawing for ink annotations. Defaults to
false
.Declaration
Objective-C
@property (nonatomic, readonly) 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.
Magic Ink uses the tool
.ink
with the variant.inkMagic
.Defaults to 70.
Declaration
Objective-C
@property (nonatomic, readonly) NSUInteger magicInkReplacementThreshold;
Swift
var magicInkReplacementThreshold: UInt { get }
-
Determines whether new annotations are created when strokes end. Defaults to
.automatic
.The PDF spec allows an unlimited number of separate paths per ink annotation object. They all need to have the same color and width.
Note
This does not affect undo - undo is smart and tracks paths individually.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFDrawCreateMode drawCreateMode;
Swift
var drawCreateMode: DrawCreateMode { get }
-
If
true
, asks the user to specify a custom annotation username (“author”) when first creating a new annotationThis is triggered by the
AnnotationStateManager
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 totrue
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL shouldAskForAnnotationUsername;
Swift
var shouldAskForAnnotationUsername: Bool { get }
-
Controls if a second tap to an annotation that allows inline editing enters edit mode. Defaults to
true
. (The most probable candidate for this isFreeTextAnnotation
)Declaration
Objective-C
@property (nonatomic, readonly) BOOL annotationEntersEditModeAfterSecondTapEnabled;
Swift
var annotationEntersEditModeAfterSecondTapEnabled: Bool { get }
-
Scrolls to affected page during an undo/redo operation. Defaults to
true
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL shouldScrollToChangedPage;
Swift
var shouldScrollToChangedPage: Bool { get }
-
Controls the sound annotation player style. Defaults to
.bottom
.This must be set in the configuration when the
PDFViewController
is initialized. Applying a configuration that changes this property after loading is not supported.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFSoundAnnotationPlayerStyle soundAnnotationPlayerStyle;
Swift
var soundAnnotationPlayerStyle: SoundAnnotationPlayerStyle { get }
-
Whether PSPDFKit should save automatically in response to certain UI triggers, such as the app entering the background or the view disappearing.
Defaults to
true
because users generally expect saving to be automatic on iOS. The exact save triggers may change between PSPDFKit versions. See https://pspdfkit.com/guides/ios/annotations/annotation-and-bookmark-saving-triggers/ for details.Set this property to
false
if you want to save with different triggers, such as when the user manually requests this. You can save using theDocument
methodsave(options:)
orsave(options:completion:)
.To fully disable a
Document
from saving, set itsannotationSaveMode
to.disabled
. See https://pspdfkit.com/guides/ios/annotations/annotation-saving-mechanism/ for details.Implement
PDFDocumentDelegate
to be notified when automatic saving succeeds or fails.Declaration
Objective-C
@property (nonatomic, readonly, getter=isAutosaveEnabled) BOOL autosaveEnabled;
Swift
var isAutosaveEnabled: Bool { get }
-
Whether automatic saving should happen on a background thread.
Defaults to
false
, which means automatic saving will run on the main thread.If saving on the main thread is a performance issue due to saving large documents then this property can be set
true
to tell PSPDFKit to auto-save on a background thread.Note
Make sure that you don’t re-create theDocument
object if you enable background saving, otherwise you might run into race conditions where the old object is still saving and the new one might load outdated or corrupted data.This property has no effect if automatic saving is disabling by setting
isAutosaveEnabled
tofalse
. SeeisAutosaveEnabled
for details about automatic saving.Declaration
Objective-C
@property (nonatomic, readonly) 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 (nonatomic, readonly) 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 (nonatomic, readonly) 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
.modal
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFSearchMode searchMode;
Swift
var searchMode: SearchMode { 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 (nonatomic, readonly) CGFloat searchResultZoomScale;
Swift
var searchResultZoomScale: CGFloat { get }
-
Whether signatures should be saved after creation.
This will be ignored (and signatures will not be saved) if
signatureStore
is nil.Defaults to
.saveIfSelected
, which means the user is given the choice whether to save signatures or not.To always save signatures without giving the user the choice, set a
signatureStore
and setsignatureSavingStrategy
to.alwaysSave
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFSignatureSavingStrategy signatureSavingStrategy;
Swift
var signatureSavingStrategy: SignatureSavingStrategy { get }
-
Defines if the user should be able to select certificates for digitally signing a document, when creating a new signature. Defaults to
.ifAvailable
.Will always show the certificate button on the signature creation UI, when set to
.always
. Will never show the certificate button on the signature creation UI, when set to.never
. Will only show the certificate button on the signature creation UI, when there areregisteredSigners
on the sharedPDFSignatureManager
, when set to.ifAvailable
. This is the default mode.This is only used if your license contains the Digital Signatures component and was originally purchased before the introduction of the Electronic Signatures component in March 2021. If you originally purchased after this date, Digital Signatures does not provide any UI for adding signatures. The Electronic Signatures component does not support selecting certificates.
Declaration
Objective-C
@property (nonatomic, readonly) PSPDFSignatureCertificateSelectionMode signatureCertificateSelectionMode;
Swift
var signatureCertificateSelectionMode: SignatureCertificateSelectionMode { 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 (nonatomic, readonly) PSPDFSignatureBiometricPropertiesOption signatureBiometricPropertiesOptions;
Swift
var signatureBiometricPropertiesOptions: PDFSignatureBiometricProperties.Option { get }
-
Enables natural drawing for signatures. Defaults to
true
. This is only used when Electronic Signatures is not enabled and Annotations is enabled in your license from before the introduction of Electronic Signatures. For Electronic Signatures, usesignatureCreationConfiguration
instead.Declaration
Objective-C
@property (nonatomic, readonly) BOOL naturalSignatureDrawingEnabled;
Swift
var naturalSignatureDrawingEnabled: Bool { get }
-
Configuration for the Electronic Signatures creation UI. Defaults to the default signature creation configuration.
Declaration
Objective-C
@property (nonatomic, readonly) NS_REFINED_FOR_SWIFT PSPDFSignatureCreationConfiguration *signatureCreationConfiguration;
-
The object that loads and saves signature annotations. You can implement a signature store to use your own backend.
If Electronic Signatures is enabled in your license then this defaults to nil, which means signatures can’t be saved. To enable simple on-device signature storage, set this to an instance of
KeychainSignatureStore
.If Annotations is enabled in your license from before the introduction of Electronic Signatures (and Electronic Signatures is not enabled) then this defaults to an instance of
KeychainSignatureStore
.To remove the UI option to choose whether to save signatures and force them to be saved, change the
signatureSavingStrategy
property or set this store to nil.Read more about signature storage options at https://pspdfkit.com/guides/ios/signatures/signature-storage/
Declaration
Objective-C
@property (nonatomic, readonly, nullable) id<PSPDFSignatureStore> signatureStore;
Swift
var signatureStore: SignatureStore? { get }
-
A list of configurations to use when sharing documents.
Includes a configuration for sharing to
UIActivityViewController
by default.Declaration
Objective-C
@property (nonatomic, readonly) NSArray<PSPDFDocumentSharingConfiguration *> *_Nonnull sharingConfigurations;
Swift
var sharingConfigurations: [DocumentSharingConfiguration] { 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 (nonatomic, readonly, nullable) PSPDFDocumentSharingDestination selectedSharingDestination;
Swift
var selectedSharingDestination: DocumentSharingConfiguration.Destination? { get }
-
Options that will be presented by
PDFSettingsViewController
. Defaults to.default
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFSettingsOptions settingsOptions;
Swift
var settingsOptions: PDFSettingsViewController.Options { get }
-
Enable/Disable all internal gesture recognizers. Defaults to
true
. Can be useful if you’re doing custom drawing on thePDFPageView
.Declaration
Objective-C
@property (nonatomic, readonly) 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 tofalse
.Note
When using this feature, you should also implement bothchildViewControllerForStatusBarHidden
andchildViewControllerForStatusBarStyle
to return thePDFViewController
instance that is embedded.Declaration
Objective-C
@property (nonatomic, readonly) BOOL useParentNavigationBar;
Swift
var useParentNavigationBar: Bool { get }
-
If enabled, will request that all thumbnails are pre-cached in
PDFViewController’s
viewDidAppear:
. Defaults tofalse
. It will also result inThumbnailViewController
pre-caching thumbnails in the alternative device orientation. This property beingfalse
will not preventThumbnailViewController
from pre-caching for the current view size when it appears. Set this totrue
if you want to pre-cache 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 (nonatomic, readonly) 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
AnnotationTableViewController
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
true
.Declaration
Objective-C
@property (nonatomic, readonly) 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 betrue
only ifAnnotation.Tool.signature
is included inPDFConfiguration.editableAnnotationTypes
.Declaration
Objective-C
@property (nonatomic, readonly) BOOL allowRemovingDigitalSignatures;
Swift
var allowRemovingDigitalSignatures: Bool { get }
-
The configuration used for the gallery system. Defaults to
GalleryConfiguration.default()
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFGalleryConfiguration *_Nonnull galleryConfiguration;
Swift
var galleryConfiguration: PSPDFGalleryConfiguration { get }
-
Configures how and where Drag and Drop should work. Defaults to
DragAndDropConfiguration.default())
.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFDragAndDropConfiguration *_Nonnull dragAndDropConfiguration;
Swift
var dragAndDropConfiguration: DragAndDropConfiguration { get }
-
A configuration set up with appropriate settings for image display.
Declaration
Objective-C
@property (class, nonatomic, readonly) PSPDFConfiguration *_Nonnull imageConfiguration;
Swift
class var image: PDFConfiguration { get }
-
Configuration options for various document editor controllers.
Declaration
Objective-C
@property (nonatomic, readonly) PSPDFDocumentEditorConfiguration *_Nonnull documentEditorConfiguration;
Swift
var documentEditorConfiguration: PSPDFDocumentEditorConfiguration { get }
-
An object that configures the annotation menu.
Declaration
Objective-C
@property (nonatomic, readonly) PSPDFAnnotationMenuConfiguration *_Nonnull annotationMenuConfiguration;
Swift
var annotationMenuConfiguration: PSPDFAnnotationMenuConfiguration { get }
-
Declaration
Swift
public var signatureCreationConfiguration: SignatureCreationViewController.Configuration { get }