API Documentation
Text API
The text
object is an instance accessible from the main mupdfwv.MuPDFWebViewer instance as follows:
This assumes you have returned your instance name as mupdf
from the initMuPDFWebViewer() promise!
text
The text
object has the following methods:
search
search(config: { keyword: string; caseSensitive?: boolean; useRegex?: boolean; pageRange?: string })
Searches for text.
- Arguments:
- config – The configuration object.
Config object:
- Arguments:
- keyword – (required) Search keyword.
- caseSensitive – (optional) Whether to be case sensitive.
- useRegex – (optional) Whether to use regular expressions.
- pageRange – (optional) Page index range to search (e.g., “1-5, 7, 9-12”, “all”). If not set will search all pages.
- Returns:
Promise<{ results: { words: { prefix: string; keyword: string; suffix: string; redMarked: boolean; rects: mupdfwv.TRect[]; }[]; pageIndex: number; }[]; }
.
Example