PSPDFAnnotationSummarizer
Objective-C
@interface PSPDFAnnotationSummarizer : NSObject
Swift
class AnnotationSummarizer : NSObject
Produces a summary of the annotations in a document.
-
Unavailable
Not the designated initializer
Undocumented
Declaration
Objective-C
PSPDF_EMPTY_INIT_UNAVAILABLE
-
Unavailable
Not the designated initializer
Undocumented
Declaration
Objective-C
PSPDF_EMPTY_INIT_UNAVAILABLE
-
Initialize the annotation summarizer with a document.
Declaration
Objective-C
- (nonnull instancetype)initWithDocument:(nonnull PSPDFDocument *)document;
Swift
init(document: PSPDFDocument)
-
The document to generate the annotation summary out of.
Declaration
Objective-C
@property (nonatomic, readonly) PSPDFDocument *_Nonnull document;
Swift
var document: PSPDFDocument { get }
-
Returns the annotation summary as a formatted string for the indexes in
pages
.Note
If the summary generation is cancelled while this method is executing, it will return
nil
.Declaration
Objective-C
- (nullable NSAttributedString *)annotationSummaryForPages: (nonnull NSIndexSet *)pages;
Swift
func annotationSummary(forPages pages: IndexSet) -> NSAttributedString?
Parameters
pages
The pages to scan for annotations to generate the summary.
-
Returns the annotation summary as a formatted string for the indexes in
pages
, and reports progress.Note
If the summary generation is cancelled while this method is executing, it will return
nil
.Declaration
Objective-C
- (nullable NSAttributedString *) annotationSummaryForPages:(nonnull NSIndexSet *)pages progress: (void (^_Nullable)(NSUInteger, CGFloat))progressBlock;
Swift
func annotationSummary(forPages pages: IndexSet, progress progressBlock: ((UInt, CGFloat) -> Void)? = nil) -> NSAttributedString?
Parameters
pages
The pages to scan for annotations to generate the summary.
progressBlock
Block to observe the progress of summarizing the annotations.
-
Cancels the annotation summary generation, if currently in progress.
-
Generates a PDF file with the annotation summary for the document at the provided pages.
Declaration
Objective-C
- (void)temporaryPDFFileURLForPages:(nonnull NSIndexSet *)pages completionBlock: (nonnull void (^)(NSURL *_Nullable, NSError *_Nullable))completionBlock;
Swift
func temporaryPDFFileURL(forPages pages: IndexSet) async throws -> URL
Parameters
pages
The pages to scan for annotations to generate the summary.
completionBlock
Called when the temporary file creation has either completed or failed.
-
Generates a PDF file with the annotation summary for the document at the provided pages.
Declaration
Objective-C
- (void)temporaryPDFFileURLForPages:(nonnull NSIndexSet *)pages progress:(void (^_Nullable)(NSUInteger, CGFloat))progressBlock completionBlock: (nonnull void (^)(NSURL *_Nullable, NSError *_Nullable))completionBlock;
Swift
func temporaryPDFFileURL(forPages pages: IndexSet, progress progressBlock: ((UInt, CGFloat) -> Void)?) async throws -> URL
Parameters
pages
The pages to scan for annotations to generate the summary.
progressBlock
Reports the progress of generating the annotation summary.
completionBlock
Called when the temporary file creation has either completed or failed.