Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ActorViewer

The FillableViewer class provides an interface for displaying, serializing, and observing form-fillable PDFs, all while connecting their data to a specific actor. Extends the Fillable Viewer.

Hierarchy

Index

Constructors

constructor

  • new ActorViewer(actor: Actor, pdfData: PDFData, sheet: PDFActorSheetAdapter, options?: ApplicationOptions): ActorViewer

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

entityType

  • get entityType(): "Actor" | "Item"

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

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<any>

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.

getSheetId

  • getSheetId(): string | undefined

getSheetPdf

  • getSheetPdf(): PDFData | undefined

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?: undefined | number): Promise<void>

refreshTitle

  • refreshTitle(): 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

setSheetId

  • setSheetId(value: string | undefined): Promise<Actor<any>>

Generated using TypeDoc