PTFreeTextCreate
@interface PTFreeTextCreate : PTTool <UITextViewDelegate>
Creates a free text annotation.
-
The
UITextView
instance used for interactive text entry.Declaration
Objective-C
@property (nonatomic, strong, readwrite, nullable) UITextView *textView;
Swift
var textView: UITextView? { get set }
-
Commits the free text annotation to the document.
Declaration
Objective-C
- (void)commitAnnotation;
Swift
func commitAnnotation()
-
Creates a free text annotation from the tool’s current state.
Declaration
Objective-C
- (nonnull PTFreeText *)createFreeText;
Swift
func createFreeText() -> PTFreeText
Return Value
a new
PTFreeText
instance for the current document -
Sets the rect of the free text annotation.
Declaration
Objective-C
- (void)setRectForFreeText:(nonnull PTFreeText *)freeText;
Swift
func setRectFor(_ freeText: PTFreeText)
Parameters
freeText
the free text annotation
-
Applies the text color, border appearance, and other properties to the free text annotation before it is committed.
Declaration
Objective-C
- (void)setPropertiesForFreeText:(nonnull PTFreeText *)freeText;
Swift
func setPropertiesFor(_ freeText: PTFreeText)
Parameters
freeText
the free text annotation
-
Sets the rect for a
PTFreeText
annotation.Declaration
Objective-C
+ (void)setRectForFreeText:(nonnull PTFreeText *)freeText withRect:(nonnull PTPDFRect *)rect pdfViewCtrl:(nonnull PTPDFViewCtrl *)pdfViewCtrl isRTL:(BOOL)isRTL;
Swift
class func setRectFor(_ freeText: PTFreeText, with rect: PTPDFRect, pdfViewCtrl: PTPDFViewCtrl, isRTL: Bool)
Parameters
freeText
The
PTFreeText
object.rect
The
PTPDFRect
representation of the associatedUITextView
.pdfViewCtrl
The
PTPDFViewCtrl
object.isRTL
A
BOOL
indicating whether the text is in a right-to-left language. -
Sets the free text appearance as is rendered by the iOS UI.
The annotation’s rotation will be rendered in accordance with its rotation flag.
Declaration
Objective-C
+ (void)refreshAppearanceForAnnot:(nonnull PTFreeText *)freeText onDoc:(nonnull PTPDFDoc *)doc;
Swift
class func refreshAppearance(forAnnot freeText: PTFreeText, on doc: PTPDFDoc)
Parameters
freeText
The
PTFreeText
annotation that needs its appearance refreshed.doc
The
PTPDFDoc
that the annotation is part of. -
Creates a new appearance for a
PTFreeText
annotation that ensures it is facing up at the time of creation.Declaration
Objective-C
+ (void)createAppearanceForAnnot:(nonnull PTFreeText *)freeText onDoc:(nonnull PTPDFDoc *)doc withViewerRotation:(PTRotate)viewerRotation;
Swift
class func createAppearance(forAnnot freeText: PTFreeText, on doc: PTPDFDoc, withViewerRotation viewerRotation: PTRotate)
Parameters
freeText
The
PTFreeText
annotation that needs a new appearance.doc
The
PTPDFDoc
that the annotation is part of.viewerRotation
The current rotation of the
PTPDFViewCtrl
.