CPDFSelection Class Reference

Inherits from NSObject
Declared in CPDFSelection.h

Overview

A CPDFSelection object identifies a contiguous or noncontiguous selection of text in a PDF document.

– initWithPage:rect:

- (instancetype)initWithPage:(CPDFPage *)page rect:(CGRect)rect

  page

Returns the page where the selection is located.

@property (nonatomic, readonly) CPDFPage *page

Discussion

Returns the page where the selection is located.

Declared In

CPDFSelection.h

  bounds

Returns the bounds of the selection on the page.

@property (nonatomic, readonly) CGRect bounds

Discussion

Returns the bounds of the selection on the page.

The selection rectangle is given in page space. Page space is a coordinate system with the origin at the lower-left corner of the current page.

Declared In

CPDFSelection.h

  range

Returns a range of contiguous text on the page.

@property (nonatomic, readonly) NSRange range

Discussion

Returns a range of contiguous text on the page.

Declared In

CPDFSelection.h

  transformedQuadPoints

@property (nonatomic, readonly) NSArray<NSValue*> *transformedQuadPoints

  selectionsByLine

Returns an array of selections, one for each line of text covered by the receiver.

@property (nonatomic, readonly) NSArray<CPDFSelection*> *selectionsByLine

Discussion

Returns an array of selections, one for each line of text covered by the receiver.

If you call this method on a CPDFSelection object that represents a paragraph, for example, selectionsByLine returns an array that contains one CPDFSelection object for each line of text in the paragraph.

Declared In

CPDFSelection.h

– string

Returns an NSString object representing the text contained in the selection (may contain linefeed characters).

- (NSString *)string

Discussion

Returns an NSString object representing the text contained in the selection (may contain linefeed characters).

Declared In

CPDFSelection.h

  markupType

The markup type used for real-time selection preview rendering.

@property (nonatomic, assign) CPDFMarkupType markupType

Discussion

The markup type used for real-time selection preview rendering.

Set this property to control the visual style of the selection preview. Supported types include highlight, underline, strikeout, and squiggly. The default value is \c CPDFMarkupTypeHighlight.

See Also

Declared In

CPDFSelection.h

  selectionColor

The color used to long press to select.

@property (nonatomic, strong) CPDFKitPlatformColor *selectionColor

Discussion

The color used to long press to select.

Default is a light blue color.

Declared In

CPDFSelection.h