PTAnnotationPasteboard
@interface PTAnnotationPasteboard : NSObject
A PTAnnotationPasteboard instance facilitates annotation copying and pasting on the behalf of a
PTPDFViewCtrl or PTToolManager instance. Annotation pasteboards can be shared between multiple
PDFViewCtrls, viewers, tabs, etc. to allow annotations to be easily copied between documents.
-
The default annotation pasteboard, which is shared between different
PTToolManagerinstances.Declaration
Objective-C
@property (class, nonatomic, strong, readonly) PTAnnotationPasteboard *_Nonnull defaultPasteboard;Swift
class var `default`: PTAnnotationPasteboard { get } -
The source page number of the copied annotation(s). If there are no copied annotations.
Declaration
Objective-C
@property (nonatomic) int sourcePageNumber;Swift
var sourcePageNumber: Int32 { get set } -
Copies the specified annotations to the pasteboard. *
- - parameter: annotations The annotations to be copied. *
- - parameter: pdfViewCtrl The PDFViewCtrl containing the annotations’ document. *
- - parameter: completion The block to execute after the annotations have been copied. You may specifiy
nilfor this parameter.
Declaration
Objective-C
- (void)copyAnnotations:(nonnull NSArray<PTAnnot *> *)annotations withPDFViewCtrl:(nonnull PTPDFViewCtrl *)pdfViewCtrl fromPageNumber:(int)pageNumber completion:(void (^_Nullable)(void))completion;Swift
func copyAnnotations(_ annotations: [PTAnnot], with pdfViewCtrl: PTPDFViewCtrl, fromPageNumber pageNumber: Int32) async -
Pastes the pasteboard’s copied annotations on the specified page number and page-coordinate location of the
PTPDFViewCtrlinstance.Declaration
Objective-C
- (void)pasteAnnotationsOnPageNumber:(int)pageNumber atPagePoint:(nonnull PTPDFPoint *)pagePoint withPDFViewCtrl:(nonnull PTPDFViewCtrl *)pdfViewCtrl completion: (void (^_Nullable)(NSArray<PTAnnot *> *_Nullable, NSError *_Nullable))completion;Swift
func pasteAnnotations(onPageNumber pageNumber: Int32, atPagePoint pagePoint: PTPDFPoint, with pdfViewCtrl: PTPDFViewCtrl) async throws -> [PTAnnot]Parameters
pageNumberThe page number on which to paste the annotations.
pagePointThe page-coordinates location at which to paste the annotations.
pdfViewCtrlThe PDFViewCtrl to which the annotations will be pasted.
completionThe block to execute after the annotations have been pasted. The pasted annotations are passed to the block on success, or an
NSErrorobject is passed in the case of an error. You may specifynilfor this parameter. -
Pastes the pasteboard’s copied annotations on the specified page number and page-coordinate location of the
PTPDFViewCtrlinstance.Declaration
Objective-C
- (void)pasteAnnotationsOnPageNumber:(int)pageNumber atPagePoint:(nonnull PTPDFPoint *)pagePoint withToolManager:(nonnull PTToolManager *)toolManager completion: (void (^_Nullable)(NSArray<PTAnnot *> *_Nullable, NSError *_Nullable))completion;Swift
func pasteAnnotations(onPageNumber pageNumber: Int32, atPagePoint pagePoint: PTPDFPoint, with toolManager: PTToolManager) async throws -> [PTAnnot]Parameters
pageNumberThe page number on which to paste the annotations.
pagePointThe page-coordinates location at which to paste the annotations.
toolManagerThe tool manager to whose
PTPDFViewCtrlthe annotations will be pasted.completionThe block to execute after the annotations have been pasted. The pasted annotations are passed to the block on success, or an
NSErrorobject is passed in the case of an error. You may specifynilfor this parameter. -
Clears the pasteboard of all copied annotations.
Declaration
Objective-C
- (void)clear;Swift
func clear()
PTAnnotationPasteboard Class Reference