PTTextMarkup

@interface PTTextMarkup : PTMarkup

A TextMarkup is a base class for highlight, underline, strikeout, and squiggly annotations.

  • Creates a TextMarkup 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)initWithAnn: (PTAnnot*)ann;

    Swift

    init!(ann: PTAnnot!)
  • Returns the number of QuadPoints in the QuadPoints array of the TextMarkup annotation (PDF 1.6)

    Note

    QuadPoints specify the coordinates of quadrilaterals in default user space. Each quadrilateral encompasses a word or group of contiguous words in the text underlying the annotation. The four points(p1, p2, p3, p4) of a QuadPoint specify the quadrilateral’s four vertices in counterclockwise order. The text needs to be oriented with respect to the edge connecting points (p1) and (p2). The annotation dictionary’s Appearance entry, if present, takes precedence over QuadPoints.

    Declaration

    Objective-C

    - (int)GetQuadPointCount;

    Swift

    func getQuadPointCount() -> Int32

    Return Value

    The number of QuadPoints.

  • Returns the QuadPoint located at a certain index of the QuadPoint array. (PDF 1.6)

    Note

    QuadPoints specify the coordinates of quadrilaterals in default user space. Each quadrilateral encompasses a word or group of contiguous words in the text underlying the annotation. The four points(p1, p2, p3, p4) of a QuadPoint specify the quadrilateral’s four vertices in counterclockwise order. The text needs to be oriented with respect to the edge connecting points (p1) and (p2). The annotation dictionary’s Appearance entry, if present, takes precedence over QuadPoints.

    Declaration

    Objective-C

    - (PTQuadPoint *)GetQuadPoint:(int)idx;

    Swift

    func getQuadPoint(_ idx: Int32) -> PTQuadPoint!

    Parameters

    idx

    The index where the QuadPoint is located. The index starts at zero and must be less than return value of GetQuadPointCount().

    Return Value

    The QuadPoint located at a certain index of the QuadPoint array of the TextMarkup annotation.

  • Sets the QuadPoint to be located at a certain index of the QuadPoint array. (Optional; PDF 1.6 )

    Note

    An array of n QuadPoints specifying the coordinates of n quadrilaterals in default user space. Each quadrilateral shall encompasses a word or group of contiguous words in the text underlying the annotation. The coordinates for each quadrilateral shall be given in the order p1, p2, p3, p4 specifying the quadrilateral’s four vertices in counterclockwise order. The text shall be oriented with respect to the edge connecting points (p1) and (p2). The annotation dictionary’s Appearance(AP) entry, if present, shall take precedence over QuadPoints.

    Declaration

    Objective-C

    - (void)SetQuadPoint:(int)idx qp:(PTQuadPoint *)qp;

    Swift

    func setQuadPoint(_ idx: Int32, qp: PTQuadPoint!)

    Parameters

    idx

    The index where the QuadPoint is to be located (the index is counted from 0).

    qp

    The QuadPoint to be located at a certain index of the QuadPoint array of the TextMarkup annotation. @attention To make this QuadPoint compatible with Adobe Acrobat|Reader, you can use either clockwise or counterclockwise order, but the points p3 and p4 must be swapped. This is because those readers do not follow the PDF specification for TextMarkup QuadPoints.