Instance API

Core Instance Methods

Navigation, zoom, state updates, and lifecycle methods on ViewerInstance.

Lifecycle

  • mount()
  • destroy()
  • load(source)
  • unload()
  • nextPage()
  • prevPage()
  • goToPage(pageNumber)

Zoom

  • getZoom()
  • setZoom(zoom)
  • zoomIn()
  • zoomOut()

State APIs

  • setViewState(updater)
  • setSearchState(updater)
  • setUI(ui)
  • setLocale(locale)

Example

instance.setViewState((state) => state.set('currentPageIndex', 4).set('zoom', 'FIT_TO_WIDTH'));
await instance.setLocale('fa-ir');