PTFreeTextCreate
@interface PTFreeTextCreate : PTTool <UITextViewDelegate>
Creates a free text annotation.
-
The
PTFreeTextView
instance used for interactive text entry.Declaration
Objective-C
@property (nonatomic, strong, readonly) PTFreeTextView *_Nonnull textView;
Swift
var textView: PTFreeTextView { get }
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithPDFViewCtrl:(PTPDFViewCtrl *)pdfViewCtrl textView:(UITextView *)textView;
Swift
init(pdfViewCtrl: PTPDFViewCtrl, textView: UITextView)
-
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
. -
Creates a styled
UITextView
with properties from aPTFreeText
annotation.Declaration
Objective-C
+ (nonnull UITextView *)textViewForAnnot:(nonnull PTFreeText *)freeText onPageNumber:(int)pageNumber withPDFViewCtrl:(nonnull PTPDFViewCtrl *)pdfViewCtrl;
Swift
class func textView(forAnnot freeText: PTFreeText, onPageNumber pageNumber: Int32, with pdfViewCtrl: PTPDFViewCtrl) -> UITextView
Parameters
freeText
The
PTFreeText
object.pageNumber
The page number on which the annotation exists.
pdfViewCtrl
The
PTPDFViewCtrl
object. -
Gets the unrotated rect from a
PTFreeText
annotation.Declaration
Parameters
rect
The rotated rect of a
PTFreeText
annotation.degree
The rotated degree of a
PTFreeText
annotation.Return Value
The unrotated rect of the
PTFreeText
annotation. -
Gets the
PTRotate
value from a rotated degree value.Declaration
Objective-C
+ (PTRotate)getAnnotationRotation:(double)degree;
Swift
class func getAnnotationRotation(_ degree: Double) -> PTRotate
Parameters
degree
The rotated degree of a
PTFreeText
annotation.Return Value
The
PTRotate
value of the degree.