Implements

Constructors

  • Create a DocView instance. Instead of creating an instance in new mode, use create to create an instance.

    Parameters

    • Optionaloptions: Options

      The options to create a DocView instance.

    Returns DocView

     const docview = await DocView.create();
    

Properties

doc: null | Doc
options: Options

Methods

  • Destroy DocView instance.

    Returns Promise<void>

  • Immediately render the current view.

    Returns Promise<void>

  • Retrieve the PDF document object.

    Returns Promise<null | DocType>

    • A PDF document object
  • Retrieve the page view.

    Parameters

    • index: number

      The index of the page view, starting from 0

    Returns Promise<null | PageViewType>

    • A page view
  • Retrieve the number of page views.

    Returns Promise<number>

    • The number of page views
  • Retrieve the rotation angle.

    Returns Promise<number>

    • The rotation angle.
  • Retrieve the visible page view based on the index.

    Parameters

    • index: number

      The page index, starting from 0.

    Returns Promise<null | PageViewType>

    • PageView object.
  • Retrieve the zoom ratio

    Returns Promise<number>

    • The zoom ratio
  • Navigate to the previous position.

    Returns Promise<void>

  • Navigate to the next position.

    Returns Promise<void>

  • Navigate to the specified page.

    Parameters

    • index: number

      The page number, starting from 0.

    Returns Promise<void>

  • Navigate to the specified rectangular area on the specified page.

    Parameters

    • index: number

      The page number, starting from 0.

    • rect: Rect

      The rectangular area.

    • isTopUp: boolean = true

      Whether to scroll to the top or bottom of the page. Defaults to true.

    • maxScale: number = 1

      The maximum zoom ratio. Defaults to 1.

    Returns Promise<boolean>

  • Scroll to the specified coordinates.

    Parameters

    • x: number

      The target horizontal coordinate.

    • y: number

      The target vertical coordinate.

    Returns Promise<void>

  • Zoom to the specified scale ratio.

    Parameters

    • scale: number

      The scale ratio

    • Optionalmode: FRDOCVIEW_ZOOMTYPE

      The zoom type (optional, defaults to the current mode)

    Returns Promise<void>

  • Create DocView instance.

    Parameters

    • Optionaloptions: Options

      Configuration options required for creation, including necessary initialization information.

    Returns Promise<DocViewType>

    • A DocView instance.
     const docview = await DocView.create();