PTText

@interface PTText : PTMarkup

A text annotation represents a “sticky note” attached to a point in the PDF document. When closed, the annotation shall appear as an icon; when open, it shall display a pop-up window containing the text of the note in a font and size chosen by the conforming reader. Text annotations do not scale and rotate with the page (i.e. they should behave as if the NoZoom and NoRotate annotation flags).

  • Creates a Text annotation and initializes it using given Cos/SDF object.

    Note

    The constructor does not copy any data, but is instead the logical equivalent of a type cast.

    Declaration

    Objective-C

    - (instancetype)initWithD:(PTObj *)d;

    Swift

    init!(d: PTObj!)

    Parameters

    d

    The Cos/SDF object to initialze the annotation with.

  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithAnn: (PTAnnot*)ann;

    Swift

    init!(ann: PTAnnot!)
  • Creates a new Text annotation in the specified document.

    Declaration

    Objective-C

    + (PTText *)CreateTextWithRect:(PTSDFDoc *)doc
                               pos:(PTPDFRect *)pos
                          contents:(NSString *)contents;

    Swift

    class func createText(withRect doc: PTSDFDoc!, pos: PTPDFRect!, contents: String!) -> PTText!

    Parameters

    doc

    A document to which the annotation is added.

    pos

    A rectangle specifying the annotation’s bounds in default user space units.

    Return Value

    A newly created blank Text annotation.

  • Creates a new Text annotation in the specified document.

    Declaration

    Objective-C

    + (PTText *)Create:(PTSDFDoc *)doc pos:(PTPDFRect *)pos;

    Swift

    class func create(_ doc: PTSDFDoc!, pos: PTPDFRect!) -> PTText!

    Parameters

    doc

    A document to which the annotation is added.

    pos

    A rectangle specifying the annotation’s bounds in default user space units.

    contents

    The text of the annotation, that shall be displayed in its popup window.

    Return Value

    A newly created Text annotation.

  • Creates a new Text annotation in the specified document.

    Declaration

    Objective-C

    + (PTText *)CreateAnnot:(PTSDFDoc *)doc
                        pos:(PTPDFRect *)pos
                   contents:(NSString *)contents;

    Swift

    class func createAnnot(_ doc: PTSDFDoc!, pos: PTPDFRect!, contents: String!) -> PTText!

    Parameters

    doc

    A document to which the annotation is added.

    pos

    A point specifying the annotation’s location in default user space units. This determines the location of bottom left corner of the annotation’s icon.

    contents

    The text of the annotation, that shall be displayed in its popup window.

    Return Value

    A newly created Text annotation.

  • Undocumented

    Declaration

    Objective-C

    + (PTText*)CreateTextWithPoint: (PTSDFDoc*)doc pos:  (PTPDFPoint*)pos contents:  (NSString *)contents;

    Swift

    class func createText(withPoint doc: PTSDFDoc!, pos: PTPDFPoint!, contents: String!) -> PTText!
  • Returns the initial status of the Text annotation.

    Declaration

    Objective-C

    - (BOOL)IsOpen;

    Swift

    func isOpen() -> Bool

    Return Value

    A boolean value that specifies whether the annotation shall initially be displayed as opened. Default value: false.

  • Sets the initial status of the Text annotation. (Optional)

    Declaration

    Objective-C

    - (void)SetOpen:(BOOL)isopen;

    Swift

    func setOpen(_ isopen: Bool)

    Parameters

    isopen

    A boolean value that specifies whether the annotation shall initially be displayed as opened. Default value: false.

  • Returns the type of the icon associated with the Text annotation.

    Note

    The annotation’s appearance stream, if present, will take precedence over this entry.

    Declaration

    Objective-C

    - (PTTextIcon)GetIcon;

    Swift

    func getIcon() -> PTTextIcon

    Return Value

    A value of the enumeration type “Icon”. Default value: e_Note.

  • Returns the name of the icon associated with the Text annotation.

    Note

    The following icon names are equivalent to predefined icon types from the enum “Icon”: “Comment” = e_Comment “Key” = e_Key “Help” = e_Help “NewParagraph” = e_NewParagraph “Paragraph” = e_Paragraph “Insert” = e_Insert “Note” = e_Note “Unknown” = e_Unknown Names other than mentioned above do not have predefined icon appearances.

    Note

    The annotation’s appearance stream, if present, will take precedence over this entry.

    Declaration

    Objective-C

    - (NSString *)GetIconName;

    Swift

    func getIconName() -> String!

    Return Value

    A string denoting the name of the icon.

  • Undocumented

    Declaration

    Objective-C

    - (void)SetTextIconType: (PTTextIcon)icon;

    Swift

    func setTextIconType(_ icon: PTTextIcon)
  • Sets the type of the icon associated with the Text annotation. (Optional)

    Note

    The annotation’s appearance stream, if present, will take precedence over this entry.

    Declaration

    Objective-C

    - (void)SetIcon;

    Swift

    func setIcon()

    Parameters

    icon

    A value of the enum “Icon” type. Default value: e_Note.

  • Undocumented

    Declaration

    Objective-C

    - (void)SetTextIconName: (NSString *)icon;

    Swift

    func setTextIconName(_ icon: String!)
  • Returns the string indicating the state of the Text annotation. (PDF 1.5)

    Declaration

    Objective-C

    - (NSString *)GetState;

    Swift

    func getState() -> String!

    Return Value

    A string that indicates the state of the Text annotation when first loaded. Default: “Unmarked” if StateModel is “Marked”; “None” if StateModel is “Review”.

  • Sets the string indicating the state of the Text annotation. (Optional; PDF 1.5 )

    Declaration

    Objective-C

    - (void)SetState:(NSString *)state;

    Swift

    func setState(_ state: String!)

    Parameters

    state

    A string that indicates the state of the Text annotation when first loaded. Default: “Unmarked” if StateModel is “Marked”; “None” if StateModel is “Review”.

  • Returns the string indicating the state model of the Text annotation. (PDF 1.5)

    Declaration

    Objective-C

    - (NSString *)GetStateModel;

    Swift

    func getStateModel() -> String!

    Return Value

    A string containing the state model name - either “Marked” or “Review”.

  • Sets the string indicating the state model of the Text annotation. (Required if State is present, otherwise optional; PDF 1.5 )

    Declaration

    Objective-C

    - (void)SetStateModel:(NSString *)sm;

    Swift

    func setStateModel(_ sm: String!)

    Parameters

    sm

    A string containing the state model name - either “Marked” or “Review”.

  • Returns anchor point position (in relative coordinates) - the point that won’t move when the page is zoomed in/out Anchor point position is in relative coordinates [0,1], and default is upper-left corner (0,1) @return Currently stored anchor position or the default (upper-left corner (0,1))

    Declaration

    Objective-C

    - (PTPDFPoint *)GetAnchorPosition;

    Swift

    func getAnchorPosition() -> PTPDFPoint!
  • Sets anchor point position (in coordinates relative to the annotation Rect) - the point that won’t move when the page is zoomed in/out and/or if the page is rotated. @param pt Anchor point position in relative coordinates [0,1], where 0,0 is bottom left corner of the annotation, and 1,1 is top right corner. Default: 0,1

    Declaration

    Objective-C

    - (void)SetAnchorPosition:(PTPDFPoint *)pt;

    Swift

    func setAnchorPosition(_ pt: PTPDFPoint!)