PTTextMarkupEditTool
@interface PTTextMarkupEditTool : PTTextSelectTool
Tool for editing existing text markup annotations, such as highlights, underlines, etc. In addition to changing basic properties like colour and opacity, it can change the annotation’s size, and it’s type (e.g. turn a highlight into an underline).
-
Selects the specified text markup annotation.
Declaration
Objective-C
- (BOOL)selectTextMarkupAnnotation:(nonnull PTAnnot *)annotation onPageNumber:(unsigned int)pageNumber;
Swift
func selectTextMarkupAnnotation(_ annotation: PTAnnot, onPageNumber pageNumber: UInt32) -> Bool
Parameters
annotation
the annotation to select
pageNumber
the page number of the annotation
Return Value
YES
if the annotation was selected,NO
otherwise. -
Copies the PDF text under the selected text markup annotation to the system clipboard/pasteboard.
This method is called by default by the “Copy” selection menu item.
Declaration
Objective-C
- (void)copySelectedMarkupText:(nonnull id)sender;
Swift
func copySelectedMarkupText(_ sender: Any)
-
Shows a menu that allows changing the text markup type for the currently selected annotation(s).
This method is called by default by the “Type” selection menu item.
Declaration
Objective-C
- (void)editSelectedAnnotationType:(nonnull id)sender;
Swift
func editSelectedAnnotationType(_ sender: Any)
-
Flattens the currently selected text markup annotation(s).
This method is called by default by the “Flatten” selection menu item.
Declaration
Objective-C
- (void)flattenSelectedAnnotations:(nonnull id)sender;
Swift
func flattenSelectedAnnotations(_ sender: Any)
-
Whether a border is drawn around the selected text.
The bounding box of all the selected text is used for the border, matching the behavior of other multi-element annotation selections (grouped annotations, etc.).
The default value of this property is
NO
.Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isSelectionBorderEnabled) BOOL selectionBorderEnabled;
Swift
var isSelectionBorderEnabled: Bool { get set }
-
The color of the border drawn around the selected text.
When the value of this property is
nil
, the tool’s tint color (UIView.tintColor
) will be used.The default value of this property is
nil
.Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *selectionBorderColor;
Swift
@NSCopying var selectionBorderColor: UIColor? { get set }
-
The margin between the selection border and the selected text.
The default value of this property is
10pt
.Declaration
Objective-C
@property (nonatomic) CGFloat selectionRectMargin;
Swift
var selectionRectMargin: CGFloat { get set }
-
The width of the border drawn around the selected text.
The default value of this property is
1.0pt
.Declaration
Objective-C
@property (nonatomic) CGFloat selectionBorderWith;
Swift
var selectionBorderWith: CGFloat { get set }
-
The corner radius of the border drawn around the selected text.
The default value of this property is
0.0
.Declaration
Objective-C
@property (nonatomic) CGFloat selectionBorderCornerRadius;
Swift
var selectionBorderCornerRadius: CGFloat { get set }