create

open fun create(@NonNull document: PdfDocument, @IntRange(from = 0) pageIndex: Int, @NonNull range: Range, @IntRange(from = 0) snippetLength: Int): SearchResult

Creates an immutable search result with a preview snippet from page text

Return

A search result extracted from the document.

Parameters

document

Document which contains the search result.

pageIndex

0-indexed page number of the result.

range

Character range on the page marking the search result.

snippetLength

Length of the preview snippet to extract. May be 0 to not extract any snippet.


open fun create(@NonNull document: PdfDocument, @NonNull annotation: Annotation, @NonNull range: Range, @IntRange(from = 0) snippetLength: Int): SearchResult

Create an immutable search result with a preview snippet from annotation text.

Return

A search result extracted from the document.

Parameters

document

Document which contains the search result.

annotation

Annotation containing the search result.

range

Character range in annotation contents marking the search result.

snippetLength

Length of the preview snippet to extract. May be 0 to not extract any snippet.