Contents

selection(from:to:)

Returns the text between the two specified points in page space.

Declaration

func selection(from startPoint: CGPoint, to endPoint: CGPoint) -> PDFSelection?
func selection(from startPoint: NSPoint, to endPoint: NSPoint) -> PDFSelection?

Discussion

Either point may be the one closer to the start of the page. In determining the selection, the points are sorted first top to bottom and then left to right.

Page space is a 72 dpi coordinate system with the origin at the lower-left corner of the current page.

To visualize the selection, picture the rectangle defined by startPoint and endPoint. The selection begins at the first character fully within the defined rectangle and closest to its upper-left corner. The selection ends at the last character fully within the defined rectangle and closest to its lower-right corner.

See Also

Working with Selections