Web SDKv1.0.0

PDFViewer.search()

Open the search panel and run a query across all pages. Results are shown in the panel, not returned: it is a UI action. For matches as data, use doc.text.search(). Needs the extract feature: its highlights and count say where the words are (the search panel the user types in needs no feature).
methodSearchsince 1.0.0

Signature

search(query: string): Promise<void>

Parameters

ParameterTypeDescription
querystringThe words to look for.

Returns

Promise<void> Resolves once the search has run.

Throws

  • FEATURE_NOT_LICENSED without extract.
  • INVALID_STATE after destroy().

Example

TypeScript
await viewer.search('refund');

More in PDFViewer