Nutrient Web SDK

Class SearchResult

A match when searching the PDF.

You can retrieve search results by using Instance#search

Class

Hierarchy

RecordSearchResult

Properties

annotationRect

OptionalReadonly

The bounding box of the annotation in which the result was found. This property is only available when the result is an annotation.

isAnnotation

Readonly
boolean | null

Boolean to indicate whether the matching search result is part of an annotation.

number | null

Length of the search term in the preview text.

number | null

Location of the search term in the preview text.

pageIndex

Readonly
number | null

The page where the result was found.

previewText

Readonly
string

The text surrounding the search term that can be used to list a preview.

rectsOnPage

Readonly

All rects on the page that should be used to highlight the text.

Immutable Record API

31
string

The name provided to Record(values, name) can be accessed with displayName.

  • Returns

    this

    See Also

    • Map#asImmutable

  • Returns

    this

    See Also

    • Map#asMutable

  • Returns a new instance of this Record type with all values set to their default values.

    Returns

    this
  • Returns a new instance of this Record type with the value for the specific key set to its default value.

    Type Parameters

    K
    extends keyof { … }

    Parameters

    keyK

    Returns

    this
  • Parameters

    keyPathIterable<unknown>

    Returns

    this
  • Parameters

    otherunknown

    Returns

    boolean
  • Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.

    If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.

    Type Parameters

    K
    extends keyof { … }

    Parameters

    keyK
    notSetValueunknown
    Optional

    Returns

    { … }[K]
  • Type Parameters

    T

    Parameters

    keystring
    notSetValueT

    Returns

  • Parameters

    keyPathIterable<unknown>

    Returns

    unknown
  • Parameters

    keystring

    Returns

    key is
    | "pageIndex"
    | "previewText"
    | "locationInPreview"
    | "lengthInPreview"
    | "rectsOnPage"
    | "isAnnotation"
    | "annotationRect"
  • Returns

    number
  • Parameters

    keyPathIterable<unknown>

    Returns

    boolean
  • Parameters

    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    ...collectionsunknown[]

    Returns

    this
  • Parameters

    merger(oldVal: unknown, newVal: unknown, key: unknown) => unknown
    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    ...collectionsunknown[]

    Returns

    this
  • Parameters

    merger
    (oldVal: unknown, newVal: unknown, key: keyof { … }) => unknown
    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Type Parameters

    K
    extends keyof { … }

    Parameters

    keyK

    Returns

    this
  • Parameters

    keyPathIterable<unknown>

    Returns

    this
  • Type Parameters

    K
    extends keyof { … }

    Parameters

    keyK
    value
    { … }[K]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    valueunknown

    Returns

    this
  • Deeply converts this Record to equivalent native JavaScript Object.

    Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.

    Returns

    { … }
    • Optional
      annotationRect?: unknown

      The bounding box of the annotation in which the result was found. This property is only available when the result is an annotation.

    • isAnnotation: boolean | null

      Boolean to indicate whether the matching search result is part of an annotation.

    • lengthInPreview: number | null

      Length of the search term in the preview text.

    • locationInPreview: number | null

      Location of the search term in the preview text.

    • pageIndex: number | null

      The page where the result was found.

    • previewText: string

      The text surrounding the search term that can be used to list a preview.

    • rectsOnPage: unknown

      All rects on the page that should be used to highlight the text.

  • Shallowly converts this Record to equivalent native JavaScript Object.

    Returns

    { … }
    • Optional
      annotationRect?: NutrientViewer.Geometry.Rect | null

      The bounding box of the annotation in which the result was found. This property is only available when the result is an annotation.

    • isAnnotation: boolean | null

      Boolean to indicate whether the matching search result is part of an annotation.

    • lengthInPreview: number | null

      Length of the search term in the preview text.

    • locationInPreview: number | null

      Location of the search term in the preview text.

    • pageIndex: number | null

      The page where the result was found.

    • previewText: string

      The text surrounding the search term that can be used to list a preview.

    • rectsOnPage: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>

      All rects on the page that should be used to highlight the text.

  • Shallowly converts this Record to equivalent JavaScript Object.

    Returns

    { … }
    • Optional
      annotationRect?: NutrientViewer.Geometry.Rect | null

      The bounding box of the annotation in which the result was found. This property is only available when the result is an annotation.

    • isAnnotation: boolean | null

      Boolean to indicate whether the matching search result is part of an annotation.

    • lengthInPreview: number | null

      Length of the search term in the preview text.

    • locationInPreview: number | null

      Location of the search term in the preview text.

    • pageIndex: number | null

      The page where the result was found.

    • previewText: string

      The text surrounding the search term that can be used to list a preview.

    • rectsOnPage: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>

      All rects on the page that should be used to highlight the text.

  • Type Parameters

    K
    extends keyof { … }

    Parameters

    keyK
    updater
    (value: { … }[K]) => { … }[K]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    updater(value: unknown) => unknown

    Returns

    this
  • Returns

    boolean

    See Also

    • Map#wasAltered

  • Note: Not all methods can be used on a mutable collection or within withMutations! Only set may be used mutatively.

    Parameters

    mutator(mutable: this) => unknown

    Returns

    this

    See Also

    • Map#withMutations