PSPDFDocumentSharingConfiguration
Objective-C
@interface PSPDFDocumentSharingConfiguration
: PSPDFBaseConfiguration <PSPDFDocumentSharingConfigurationBuilder *>
Swift
class DocumentSharingConfiguration : BaseConfiguration<DocumentSharingConfigurationBuilder>
A PSPDFDocumentSharingConfiguration
instance configures how the sharing view controller behaves, and what options it
lets the user customize.
-
Returns a configuration suitable for the given destination.
File Format Options
The Messages, Email, Other Application, Export, and Activity destinations, by default, have the following file format options enabled:
PSPDFDocumentSharingFileFormatOptionPDF | PSPDFDocumentSharingFileFormatOptionImage | PSPDFDocumentSharingFileFormatOptionOriginal
The Print destination has only one file format option enabled by default:
PSPDFDocumentSharingFileFormatOptionPDF
Note
Please keep in mind that in the context of the Printing destination, the file format option is largely irrelevant.Page Selection Options
Every destination has the following pages options selected by default:
PSPDFDocumentSharingPagesOptionCurrent | PSPDFDocumentSharingPagesOptionRange | PSPDFDocumentSharingPagesOptionAll | PSPDFDocumentSharingPagesOptionAnnotated
Annotation Options
The Messages, Email, Other Application, Export, and Activity destinations, by default, have the following annotation options enabled:
PSPDFDocumentSharingAnnotationOptionEmbed | PSPDFDocumentSharingAnnotationOptionFlatten | PSPDFDocumentSharingAnnotationOptionRemove | PSPDFDocumentSharingAnnotationOptionSummary
The Print destination has by default the following annotation options enabled:
PSPDFDocumentSharingAnnotationOptionFlattenForPrint | PSPDFDocumentSharingAnnotationOptionRemove | PSPDFDocumentSharingAnnotationOptionSummary
See
PSPDFDocumentSharingAnnotationOptionFlattenForPrint
for additional notes on printing.Declaration
Objective-C
+ (nonnull PSPDFDocumentSharingConfiguration *) defaultConfigurationForDestination: (nonnull PSPDFDocumentSharingDestination)destination;
Swift
class func defaultConfiguration(forDestination destination: DocumentSharingConfiguration.Destination) -> DocumentSharingConfiguration
-
The file formats the documents should be allowed to be shared in.
Declaration
Objective-C
@property (nonatomic, readonly) PSPDFDocumentSharingFileFormatOptions fileFormatOptions;
Swift
var fileFormatOptions: DocumentSharingConfiguration.FileFormatOptions { get }
-
Which pages from the documents should be shared.
Declaration
Objective-C
@property (nonatomic, readonly) PSPDFDocumentSharingPagesOptions pageSelectionOptions;
Swift
var pageSelectionOptions: DocumentSharingConfiguration.PageOptions { get }
-
How the annotations should be processed when sharing the documents.
Declaration
Objective-C
@property (nonatomic, readonly) PSPDFDocumentSharingAnnotationOptions annotationOptions;
Swift
var annotationOptions: DocumentSharingConfiguration.AnnotationOptions { get }
-
The destination where the documents are going to be shared to.
Declaration
Objective-C
@property (nonatomic, readonly) PSPDFDocumentSharingDestination _Nonnull destination;
Swift
var destination: DocumentSharingConfiguration.Destination { get }
-
The print configuration to apply when sharing via the
.print
destination. Defaults tonil
.Note
Due to API limitations, this is not used when printing is invoked via the .activity destination.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFPrintConfiguration *_Nonnull printConfiguration;
Swift
var printConfiguration: PrintConfiguration { get }
-
Passed as the
applicationActivities
parameter when creating theUIActivityViewController
.Defaults to an empty array.
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSArray<UIActivity *> *_Nonnull applicationActivities;
Swift
var applicationActivities: [UIActivity] { get }
-
Used for the activity action when the
UIActivityViewController
is displayed.Defaults to
UIActivityTypeCopyToPasteboard
,UIActivityTypeAssignToContact
,UIActivityTypePostToFacebook
,UIActivityTypePostToTwitter
,UIActivityTypePostToWeibo
.The “Add to Photos” activity on Mac Catalyst will always be excluded because a system issue means selecting that option disables almost all the app’s buttons and menu items. (FB9727325)
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSArray<UIActivityType> *_Nonnull excludedActivityTypes;
Swift
var excludedActivityTypes: [UIActivity.ActivityType] { get }
-
A closure that provides a string to describe each page in the page range picker.
The page range picker is shown for the option
DocumentSharingConfiguration.PageOptions.range
. The closure is passed the index of the page to be described and the document that is being shared. Page indexes start at 0.By default this returns a string displaying
pageIndex + 1
. Set this property to a custom closure to show the page label or any other custom description.Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull (^_Nonnull) (PSPDFPageIndex, PSPDFDocument *_Nonnull) pageDescriptionProvider;
-
A block that provides a string to describe selected pages in the sharing UI.
The block is passed the selected range option, the selected page range if applicable, and the documents being shared.
pagesOption
will always have exactly one bit set. TheselectedPages
is not applicable when sharing all pages or annotated pages and should be ignored in those cases. When sharing the current page, theselectedPages
will contain exactly 1 index. Sharing the current page or a specific range is only possible when sharing a single document, sodocuments
can be assumed to contain a single entry in those cases.To use the default PSPDFKit description in some cases, keep a reference to the original block and call through to it. Set this property to a custom block to show the page label or any other custom description.
This block does not call through to
pageDescriptionProvider
. Set both blocks if you want to describe pages in a consistent way.Declaration
Objective-C
@property (nonatomic, copy, readonly) NS_REFINED_FOR_SWIFT NSString *_Nonnull (^) (PSPDFDocumentSharingPagesOptions, NSIndexSet *_Nonnull, NSArray<PSPDFDocument *> *_Nonnull) selectedPagesDescriptionProvider;
-
Pages that are selected for sharing in the sharing UI.
This acts like a resolved version of
See moreDocumentSharingConfiguration.PageOptions
.Declaration
Swift
@frozen enum SelectedPages
-
A closure that provides a string to describe selected pages in the sharing UI.
The closure is passed the currently selected pages.
To use the default PSPDFKit description in some cases, keep a reference to the original closure and call through to it. Set this property to a custom closure to show the page label or any other custom description.
This closure does not call through to
pageDescriptionProvider
. Set both closures if you want to describe pages in a consistent way.Declaration
Swift
var selectedPagesDescriptionProvider: (SelectedPages) -> String { get }
-
Declaration
Swift
extension DocumentSharingConfiguration.PageOptions: Hashable
-
Declaration
Swift
extension DocumentSharingConfiguration.FileFormatOptions: Hashable
-
Declaration
Swift
extension DocumentSharingConfiguration.AnnotationOptions: Hashable