Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StaticViewer

The PDFoundry StaticViewer class opens PDFs and provides event hooks for observing the viewer. Static viewers display a PDF but do not render or instantiate any fillable fields or their data.

You cannot create a new instance of this class, you must do so with the API.

See Api.openPDF, Api.openPDFByCode, Api.openPDFByName, Api.openURL which all return a promise which resolve with an instance of this class.

Hierarchy

Index

Constructors

constructor

Properties

appId

appId: number

The application ID is a unique incrementing integer which is used to identify every application window drawn by the VTT

options

options: ApplicationOptions

The options provided to this application upon initialization

position

position: ApplicationPosition

Track the current position and dimensions of the Application UI

Accessors

element

  • get element(): JQuery | HTMLElement
  • Return the active application element, if it currently exists in the DOM

    Returns JQuery | HTMLElement

id

  • get id(): string
  • Return the CSS application ID which uniquely references this UI element

    Returns string

page

  • get page(): number
  • set page(value: number): void

pdfData

popOut

  • get popOut(): boolean
  • Control the rendering style of the application. If popOut is true, the application is rendered in its own wrapper window, otherwise only the inner app content is rendered

    Returns boolean

rendered

  • get rendered(): boolean
  • Return a flag for whether the Application instance is currently rendered

    Returns boolean

template

  • get template(): string
  • The path to the HTML template file which should be used to render the inner content of the app

    Returns string

title

  • get title(): string

Static defaultOptions

  • get defaultOptions(): ApplicationOptions

Events Methods

off

on

once

Other Methods

close

  • close(): Promise<void>
  • Close the application and un-register references to it within UI mappings This function returns a Promise which resolves once the window closing animation concludes

    Returns Promise<void>

download

  • download(): Promise<Uint8Array>
  • Finish the download and return the byte array for the file.

    Returns Promise<Uint8Array>

    A promise that resolves to Uint8Array of file bytes once that download is finished. You can pass this to a viewer to open it, or do something else with it.

maximize

  • maximize(): Promise<boolean>
  • Maximize the pop-out window, expanding it to its original size Take no action for applications which are not of the pop-out variety or are already maximized

    Returns Promise<boolean>

    A Promise which resolves to true once the maximization action has completed

minimize

  • minimize(): Promise<boolean>
  • Minimize the pop-out window, collapsing it to a small tab Take no action for applications which are not of the pop-out variety or apps which are already minimized

    Returns Promise<boolean>

    A Promise which resolves to true once the minimization action has completed

open

  • open(pdfSource: string | Uint8Array, page?: number | string): Promise<void>

render

  • render(force?: undefined | false | true, options?: RenderOptions): Application
  • Render the Application by evaluating it's HTML template against the object of data provided by the getData method If the Application is rendered as a pop-out window, wrap the contained HTML in an outer frame with window controls

    Parameters

    • Optional force: undefined | false | true

      Add the rendered application to the DOM if it is not already present. If false, the Application will only be re-rendered if it is already present.

    • Optional options: RenderOptions

      Additional rendering options which are applied to customize the way that the Application is rendered in the DOM.

    Returns Application

setPosition

  • setPosition(__namedParameters: { height: undefined | string | number; left: undefined | number; scale: undefined | number; top: undefined | number; width: undefined | string | number }): any
  • Set the application position and store it's new location

    Parameters

    • __namedParameters: { height: undefined | string | number; left: undefined | number; scale: undefined | number; top: undefined | number; width: undefined | string | number }
      • height: undefined | string | number
      • left: undefined | number
      • scale: undefined | number
      • top: undefined | number
      • width: undefined | string | number

    Returns any

Generated using TypeDoc