Skip to content
Guides

Get the Selected Content

Users can drag the mouse or use their fingers to select text in the PDF document, obtaining the selected content in real-time.

This example shows how to Get the selected content:

swift
// Extract the selected text
let currentSelection = pdfview.currentSelection
let currentText = currentSelection?.string()
objective-c
// Extract the selected text
CPDFSelection *currentSelection = pdfView.currentSelection;
NSString *currentText = [currentSelection string];