public class

PDFViewCtrl.Selection

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.PDFViewCtrl.Selection

Class Overview

A class representing the current text selection.

Summary

Public Methods
String getAsHtml()
Get the selected text as html.
String getAsUnicode()
Get the selected text as unicode string
int getPageNum()
Get the page number containing the selected text
double[] getQuads()
Returns the list of tight bounding quads in the current text selection.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public String getAsHtml ()

Get the selected text as html.

Note: this function can be used to implement clipboard copy and paste that preserves text formatting.

Returns
  • the current text selection in HTML format. HTML text will contain styling information such as text color, font size, style etc.

public String getAsUnicode ()

Get the selected text as unicode string

Returns
  • the current text selection represented as an Unicode string.

public int getPageNum ()

Get the page number containing the selected text

Returns
  • the page number containing the selected text.

public double[] getQuads ()

Returns the list of tight bounding quads in the current text selection.

Returns
  • the list of bounding boxes