public final class

TextSearch

extends Object
java.lang.Object
   ↳ com.pspdfkit.document.search.TextSearch

Class Overview

Searches text inside a PdfDocument.

Summary

Public Constructors
TextSearch(PdfDocument document, PdfConfiguration configuration)
Creates a TextSearch instance to search the given document.
TextSearch(Context context, PdfDocument document, PdfConfiguration configuration)
This constructor is deprecated. Use TextSearch(PdfDocument, PdfConfiguration) instead.
Public Methods
List<SearchResult> performSearch(String searchString, SearchOptions searchOptions)
Performs a search on the loaded document, returning a list of all search results.
List<SearchResult> performSearch(String searchString)
Performs a search on the loaded document, returning a list of all search results.
Flowable<SearchResult> performSearchAsync(String searchString, SearchOptions searchOptions)
Performs a search on the loaded document.
Flowable<SearchResult> performSearchAsync(String searchString)
Performs a search on the loaded document.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TextSearch (PdfDocument document, PdfConfiguration configuration)

Creates a TextSearch instance to search the given document.

Parameters
document The PdfDocument to be searched.

public TextSearch (Context context, PdfDocument document, PdfConfiguration configuration)

This constructor is deprecated.
Use TextSearch(PdfDocument, PdfConfiguration) instead.

Creates a TextSearch instance to search the given document.

Parameters
context Context required for initial setup.
document The PdfDocument to be searched.

Public Methods

public List<SearchResult> performSearch (String searchString, SearchOptions searchOptions)

Performs a search on the loaded document, returning a list of all search results. If search does not find any results, this method will return an empty list.

Parameters
searchString Text to find in the document.
searchOptions Options for performing search.

public List<SearchResult> performSearch (String searchString)

Performs a search on the loaded document, returning a list of all search results. This method will use the default search options. If search does not find any results, this method will return an empty list.

Parameters
searchString Text to find in the document.

public Flowable<SearchResult> performSearchAsync (String searchString, SearchOptions searchOptions)

Performs a search on the loaded document. The returned flowable will emit search results or an error if search failed for some reason. The returned flowable uses BackpressureStrategy#BUFFER.

Parameters
searchString Text to find in the document.
searchOptions Options for performing search.

public Flowable<SearchResult> performSearchAsync (String searchString)

Performs a search on the loaded document. The returned flowable will emit search results or an error if search failed for some reason. The returned flowable uses BackpressureStrategy#BUFFER. This method will use the default search options.

Parameters
searchString Text to find in the document.