Options
All
  • Public
  • Public/Protected
  • All
Menu

It handles WebSocket communication with the JSPrintManager Client App.

Hierarchy

  • JSPrintManager

Index

Constructors

Properties

WS: NDWS

The JSPrintManager websocket.

auto_reconnect: boolean = false

If the websocket have closed, then retry to reconnect automatically

Accessors

  • get license_url(): string
  • set license_url(value: string): void
  • Gets or sets the URL to request the license info from.

    Returns string

  • Gets or sets the URL to request the license info from.

    Parameters

    • value: string

    Returns void

Methods

  • getClientAppInfo(secure?: boolean, host?: string, port?: number): Promise<unknown>
  • Returns the JSPrintManager Client App Info including version, OS and CPU.

    Parameters

    • secure: boolean = true

      True to use WebSocket Secure (wss://); otherwise false.

    • host: string = 'localhost'

      The host name, 'localhost' by default.

    • port: number = WSPORT

      The local network port number.

    Returns Promise<unknown>

  • getDefaultPaperName(printer_name: string): Promise<any>
  • Returns the default paper name for the specified printer.

    Parameters

    • printer_name: string

      The printer name.

    Returns Promise<any>

  • getDefaultTrayName(printer_name: string): Promise<any>
  • Returns the default tray name for the specified printer.

    Parameters

    • printer_name: string

      The printer name.

    Returns Promise<any>

  • getInstances(secure?: boolean, host?: string, port?: number): Promise<unknown>
  • Returns the JSPrintManager Client App instances.

    Parameters

    • secure: boolean = true

      True to use WebSocket Secure (wss://); otherwise false.

    • host: string = 'localhost'

      The host name, 'localhost' by default.

    • port: number = WSPORT

      The local network port number.

    Returns Promise<unknown>

  • getMAC(): Promise<any>
  • Returns the Media Access Control (MAC) address of the client system.

    Returns Promise<any>

  • getPaperInfo(printer_name: string, paper_name: string): Promise<any>
  • Returns paper related info (width, height, printable area) for the specified printer and paper name.

    Parameters

    • printer_name: string

      The printer name.

    • paper_name: string

      The paper name.

    Returns Promise<any>

  • getPapers(printer_name: string): Promise<any>
  • Returns the list of supported papers for the specified printer.

    Parameters

    • printer_name: string

      The printer name.

    Returns Promise<any>

  • getPrinters(): Promise<unknown>
  • Gets the list of installed printers in the client system.

    Returns Promise<unknown>

  • getPrintersInfo(detail_level?: PrintersInfoLevel, printer_name?: string, printer_icon: None): Promise<unknown>
  • Gets detailed info of each installed printer in the client system.

    Parameters

    Returns Promise<unknown>

  • getScanners(): Promise<any>
  • Returns the list of scanner devices available in the client system.

    Returns Promise<any>

  • getSerialPorts(): Promise<any>
  • Returns the list of Serial ports available in the client system.

    Returns Promise<any>

  • getSessionCertificate(): Promise<unknown>
  • Gets an unique certificate / public-key to use for encryption scenarios. The returned JSON object is {"certificate":"CERT_PEM_FORMAT", "public_key":"PUB_KEY_PEM_FORMAT"}

    Returns Promise<unknown>

  • getSystemFonts(): Promise<any>
  • Returns the list of fonts name available in the client system.

    Returns Promise<any>

  • getTrays(printer_name: string): Promise<any>
  • Returns the list of supported trays for the specified printer.

    Parameters

    • printer_name: string

      The printer name.

    Returns Promise<any>

  • getUser(): Promise<any>
  • Returns the User name of the current client system session.

    Returns Promise<any>

  • onPrinterCreated(callback: any, error: any, detail_level?: PrintersInfoLevel): string
  • Occurs when a new printer is created in the client system.

    Parameters

    • callback: any

      The callback function

    • error: any

      The error function

    • detail_level: PrintersInfoLevel = PrintersInfoLevel.Extended

      The printers info details level

    Returns string

  • onPrinterDeleted(callback: any, error: any, detail_level?: PrintersInfoLevel): string
  • Occurs when any printer is deleted from the client system.

    Parameters

    • callback: any

      The callback function

    • error: any

      The error function

    • detail_level: PrintersInfoLevel = PrintersInfoLevel.Extended

      The printers info details level

    Returns string

  • onPrinterUpdated(callback: any, error: any, detail_level?: PrintersInfoLevel): string
  • Occurs when any printer is updated in the client system.

    Parameters

    • callback: any

      The callback function

    • error: any

      The error function

    • detail_level: PrintersInfoLevel = PrintersInfoLevel.Extended

      The printers info details level

    Returns string

  • showAbout(): Promise<any>
  • Displays the About dialog of the JSPrintManager Client App.

    Returns Promise<any>

  • start(secure?: boolean, host?: string, port?: number): Promise<void>
  • Starts a WebSocket communication with the JSPrintManager Client App.

    Parameters

    • secure: boolean = true

      True to use WebSocket Secure (wss://); otherwise false.

    • host: string = 'localhost'

      The host name, 'localhost' by default.

    • port: number = WSPORT

      The local network port number.

    Returns Promise<void>

  • stop(): void
  • Closes the WebSocket connection.

    Returns void

  • unsubscribePrinterEvent(id: any): Promise<unknown>
  • Unsubscribes a given event ID

    Parameters

    • id: any

      The event ID

    Returns Promise<unknown>

  • updateClient(): Promise<any>
  • Performs the update process of the JSPrintManager Client App.

    Returns Promise<any>