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.
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 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.