PDF search matching options on Android

PdfLibrary offers advanced matching options. You pass these options with a QueryOptions object in the search() method.

The following options are available:

NameTypeDescription
generateTextPreviewsBooleanRetrieves preview snippets of text when searching and delivers them in the onSearchPreviewsGenerated() callback.
maximumResultsTotalintThe maximum amount of search results for the total of all documents.
maximumResultsPerDocumentintThe maximum amount of search results per page.
matchExactWordsBooleanOnly matches exact words. For example, “something” would not match “some.”
matchExactPhrasesBooleanOnly matches exact phrases. For example, “this is a test” would not match “this is a quick test.”

Advanced configuration

You can configure PdfLibrary to match your needs. The following properties on PdfLibrary are available:

PropertyTypeDefaultDescription
saveReversedPageTextBooleantrueIndicates if the reversed text of a PDF document should be saved. This increases the size of the cache by about two times, but it allows for ends-with searches.