JSPrintManager for Blazor
Show / Hide Table of Contents

Class JSPrintManager

JSPrintManager allows you to Print Raw Commands and Files, Manage Printers; and Scan Docs from Blazor!

Inheritance
System.Object
JSPrintManager
Namespace: Neodynamic.Blazor
Assembly: cs.temp.dll.dll
Syntax
public class JSPrintManager : IAsyncDisposable

Constructors

JSPrintManager(IJSRuntime)

Declaration
public JSPrintManager(IJSRuntime jsRuntime)
Parameters
Type Name Description
IJSRuntime jsRuntime

Properties

BluetoothDevices

Gets the detailed info of each Bluetooth device.

Declaration
public BluetoothDevice[] BluetoothDevices { get; }
Property Value
Type Description
BluetoothDevice[]

BTCommEventCache

The cache for the Bluetooth comm events.

Declaration
public List<BTCommEvent> BTCommEventCache { get; set; }
Property Value
Type Description
System.Collections.Generic.List<BTCommEvent>

ClientAppInfo

Gets the Client App info.

Declaration
public ClientAppInfo ClientAppInfo { get; }
Property Value
Type Description
ClientAppInfo

ClientAppInstances

Gets the Client App instances.

Declaration
public ClientAppInstance[] ClientAppInstances { get; }
Property Value
Type Description
ClientAppInstance[]

ClientAppVersion

Gets the JSPrintManager Client App version reported during the WebSocket handshake. It's null until the connection is open, or if the Client App does not report it.

Declaration
public string ClientAppVersion { get; }
Property Value
Type Description
System.String

ClientMAC

Gets the Media Access Control (MAC) address of the client system.

Declaration
public string ClientMAC { get; }
Property Value
Type Description
System.String

ClientPrintJobStatusCache

The cache for the ClientPrintJob status.

Declaration
public List<PrintJobStatus> ClientPrintJobStatusCache { get; set; }
Property Value
Type Description
System.Collections.Generic.List<PrintJobStatus>

ClientScanJobStatusCache

The cache for the ClientScanJob status.

Declaration
public List<ScanJobStatus> ClientScanJobStatusCache { get; set; }
Property Value
Type Description
System.Collections.Generic.List<ScanJobStatus>

ClientVideoScanJobStatusCache

The cache for the ClientVideoScanJob status.

Declaration
public List<ScanJobStatus> ClientVideoScanJobStatusCache { get; set; }
Property Value
Type Description
System.Collections.Generic.List<ScanJobStatus>

CloseReason

Gets the details about why the WebSocket connection was closed or could not be established (e.g. the SSL mode mismatch or certificate error explanation). It's null while connected.

Declaration
public WSCloseReason CloseReason { get; }
Property Value
Type Description
WSCloseReason

ConnectTimeoutMs

Gets or sets the milliseconds to wait for the WebSocket connection to the Client App worker to open before giving up. Zero disables the timeout. Default is 10000. It must be set before calling Start().

Declaration
public int ConnectTimeoutMs { get; set; }
Property Value
Type Description
System.Int32

DefaultPaperName

Gets the default paper name for a given printer.

Declaration
public string DefaultPaperName { get; }
Property Value
Type Description
System.String

DefaultTrayName

Gets the default tray name for a given printer.

Declaration
public string DefaultTrayName { get; }
Property Value
Type Description
System.String

DeviceId

Gets the device ID.

Declaration
public string DeviceId { get; }
Property Value
Type Description
System.String

HIDCommEventCache

The cache for the HID comm events.

Declaration
public List<HIDCommEvent> HIDCommEventCache { get; set; }
Property Value
Type Description
System.Collections.Generic.List<HIDCommEvent>

HidDevices

Gets the list of HID devices available in the client system.

Declaration
public HidDevice[] HidDevices { get; }
Property Value
Type Description
HidDevice[]

IppMessageResponse

Gets an IPP Message response.

Declaration
public object IppMessageResponse { get; }
Property Value
Type Description
System.Object

IsLicenseValid

Gets whether the license was validated successfully by the Client App for the current connection.

Declaration
public bool IsLicenseValid { get; }
Property Value
Type Description
System.Boolean

LastErrorMessage

Gets the last error message.

Declaration
public string LastErrorMessage { get; }
Property Value
Type Description
System.String

LicenseState

Gets the license validation state of the current connection. It's null before Start() is called.

Declaration
public LicenseValidationState? LicenseState { get; }
Property Value
Type Description
System.Nullable<LicenseValidationState>

LicenseTimeoutMs

Gets or sets the milliseconds to wait for the Client App to validate the license after connecting. Zero disables the timeout. Default is 10000. It must be set before calling Start().

Declaration
public int LicenseTimeoutMs { get; set; }
Property Value
Type Description
System.Int32
Remarks

While the license is being validated, print jobs, scan jobs, IPP messages and TCP/Serial/BT/USB/HID comms are held and sent automatically once validation finishes.

MediaTypes

Gets the supported media types for a given printer.

Declaration
public string[] MediaTypes { get; }
Property Value
Type Description
System.String[]

PaperInfo

Gets the Paper info for a given printer and paper.

Declaration
public PaperInfo PaperInfo { get; }
Property Value
Type Description
PaperInfo

Papers

Gets the supported papers for a given printer.

Declaration
public string[] Papers { get; }
Property Value
Type Description
System.String[]

Printers

Gets the list of installed printers.

Declaration
public string[] Printers { get; }
Property Value
Type Description
System.String[]

PrintersEventCache

The cache for the printers events.

Declaration
public List<PrinterEvent> PrintersEventCache { get; set; }
Property Value
Type Description
System.Collections.Generic.List<PrinterEvent>

PrintersInfo

Gets the detailed info of each installed printer.

Declaration
public PrinterInfo[] PrintersInfo { get; }
Property Value
Type Description
PrinterInfo[]

RefreshPrintersResult

Gets the RefreshPrinters result.

Declaration
public object RefreshPrintersResult { get; }
Property Value
Type Description
System.Object

Scanners

Gets the list of scanner devices available in the client system.

Declaration
public string[] Scanners { get; }
Property Value
Type Description
System.String[]

ScannersInfo

Gets the detailed info of each installed scanner.

Declaration
public ScannerInfo[] ScannersInfo { get; }
Property Value
Type Description
ScannerInfo[]

SerialCommEventCache

The cache for the serial comm events.

Declaration
public List<SerialCommEvent> SerialCommEventCache { get; set; }
Property Value
Type Description
System.Collections.Generic.List<SerialCommEvent>

SerialPorts

Gets the list of Serial ports available in the client system.

Declaration
public string[] SerialPorts { get; }
Property Value
Type Description
System.String[]

SessionCertificate

Gets the Session Certificated.

Declaration
public SessionCertificate SessionCertificate { get; }
Property Value
Type Description
SessionCertificate

ShowAboutResult

Gets the ShowAbout result.

Declaration
public object ShowAboutResult { get; }
Property Value
Type Description
System.Object

Status

Gets the current JSPrintManager WebSocket status.

Declaration
public JSPMWSStatus Status { get; }
Property Value
Type Description
JSPMWSStatus

SystemFonts

Gets the list of fonts name available in the client system.

Declaration
public string[] SystemFonts { get; }
Property Value
Type Description
System.String[]

TcpCommEventCache

The cache for the TCP/IP comm events.

Declaration
public List<TcpCommEvent> TcpCommEventCache { get; set; }
Property Value
Type Description
System.Collections.Generic.List<TcpCommEvent>

Trays

Gets the supported trays for a given printer.

Declaration
public string[] Trays { get; }
Property Value
Type Description
System.String[]

UpdateClientResult

Gets the UpdateClient result.

Declaration
public object UpdateClientResult { get; }
Property Value
Type Description
System.Object

USBCommEventCache

The cache for the USB comm events.

Declaration
public List<USBCommEvent> USBCommEventCache { get; set; }
Property Value
Type Description
System.Collections.Generic.List<USBCommEvent>

UsbDevices

Gets the list of USB devices available in the client system.

Declaration
public UsbDevice[] UsbDevices { get; }
Property Value
Type Description
UsbDevice[]

UserName

Gets the system user name.

Declaration
public string UserName { get; }
Property Value
Type Description
System.String

VideoDevices

Gets the list of video input devices available in the client system.

Declaration
public string[] VideoDevices { get; }
Property Value
Type Description
System.String[]

WorkerInstance

Gets the Worker Instance info.

Declaration
public object WorkerInstance { get; }
Property Value
Type Description
System.Object

Methods

CloseBTComm(BTComm)

Closes a Bluetooth comm.

Declaration
public void CloseBTComm(BTComm btComm)
Parameters
Type Name Description
BTComm btComm

CloseHIDComm(HIDComm)

Closes a HID comm.

Declaration
public void CloseHIDComm(HIDComm hidComm)
Parameters
Type Name Description
HIDComm hidComm

CloseSerialComm(SerialComm)

Closes a serial comm.

Declaration
public void CloseSerialComm(SerialComm serialComm)
Parameters
Type Name Description
SerialComm serialComm

CloseTcpComm(TcpComm)

Closes a TCP/IP comm.

Declaration
public void CloseTcpComm(TcpComm tcpComm)
Parameters
Type Name Description
TcpComm tcpComm

CloseUSBComm(USBComm)

Closes a USB comm.

Declaration
public void CloseUSBComm(USBComm usbComm)
Parameters
Type Name Description
USBComm usbComm

DisposeAsync()

Declaration
public ValueTask DisposeAsync()
Returns
Type Description
ValueTask

GenerateLicense(String, String, String)

Generates the license package for validation based on the specified license info.

Declaration
public static byte[] GenerateLicense(string licenseOwner, string licenseKey, string timestamp)
Parameters
Type Name Description
System.String licenseOwner

The License Owner

System.String licenseKey

The License Key

System.String timestamp

A timestamp

Returns
Type Description
System.Byte[]

The license package for validation.

GetBluetoothDevices()

Gets detailed info of each Bluetooth device in the client system.

Declaration
public Task<BluetoothDevice[]> GetBluetoothDevices()
Returns
Type Description
System.Threading.Tasks.Task<BluetoothDevice[]>

The detailed info of each Bluetooth device in the client system.

GetClientAppInfo(Int32)

Gets the Client App info.

Declaration
public Task<ClientAppInfo> GetClientAppInfo(int port = 29443)
Parameters
Type Name Description
System.Int32 port

The custom port when using white label license.

Returns
Type Description
System.Threading.Tasks.Task<ClientAppInfo>

The Client App info.

GetClientAppInstances(Int32)

Gets the Client App instances.

Declaration
public Task<ClientAppInstance[]> GetClientAppInstances(int port = 29443)
Parameters
Type Name Description
System.Int32 port

The custom port when using white label license.

Returns
Type Description
System.Threading.Tasks.Task<ClientAppInstance[]>

The Client App instances.

GetClientMAC()

Gets the Media Access Control (MAC) address of the client system.

Declaration
public Task<string> GetClientMAC()
Returns
Type Description
System.Threading.Tasks.Task<System.String>

The Media Access Control (MAC) address of the client system.

GetDefaultPaperName(String)

Gets the default paper name for a given printer.

Declaration
public Task<string> GetDefaultPaperName(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

Returns
Type Description
System.Threading.Tasks.Task<System.String>

The default paper name for a given printer.

GetDefaultTrayName(String)

Gets the default tray name for a given printer.

Declaration
public Task<string> GetDefaultTrayName(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

Returns
Type Description
System.Threading.Tasks.Task<System.String>

The default tray name for a given printer.

GetDeviceId()

Gets the device ID.

Declaration
public Task<string> GetDeviceId()
Returns
Type Description
System.Threading.Tasks.Task<System.String>

The device ID.

GetFastLaneStatus()

Gets the current status of the fast lane WebSocket. Closed if StartFastLane() was not called.

Declaration
public Task<JSPMWSStatus> GetFastLaneStatus()
Returns
Type Description
System.Threading.Tasks.Task<JSPMWSStatus>

GetHidDevices()

Gets the list of HID devices available in the client system.

Declaration
public Task<HidDevice[]> GetHidDevices()
Returns
Type Description
System.Threading.Tasks.Task<HidDevice[]>

The list of HID devices available in the client system.

GetMediaTypes(String)

Gets the supported media types for a given printer.

Declaration
public Task<MediaTypesInfo> GetMediaTypes(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

Returns
Type Description
System.Threading.Tasks.Task<MediaTypesInfo>

The supported media types for a given printer.

GetPaperInfo(String, String)

Gets the Paper info.

Declaration
public Task<PaperInfo> GetPaperInfo(string printerName, string paperName)
Parameters
Type Name Description
System.String printerName

The printer name.

System.String paperName

The paper name.

Returns
Type Description
System.Threading.Tasks.Task<PaperInfo>

The Paper info.

GetPapers(String)

Gets the supported papers for a given printer.

Declaration
public Task<PapersInfo> GetPapers(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

Returns
Type Description
System.Threading.Tasks.Task<PapersInfo>

The supported papers for a given printer.

GetPrinters(Boolean, Boolean)

Gets the list of installed printers in the client system.

Declaration
public Task<string[]> GetPrinters(bool localsOnly = false, bool useFastLane = true)
Parameters
Type Name Description
System.Boolean localsOnly

If true, then local printers only will be listed. Default is false.

System.Boolean useFastLane

If true (default), the fast lane connection is used when it's open (see StartFastLane); otherwise the main connection is used.

Returns
Type Description
System.Threading.Tasks.Task<System.String[]>

The list of installed printers in the client system.

GetPrintersInfo(String, PrinterIcon, Boolean, Boolean)

Gets detailed info of each installed printer in the client system.

Declaration
public Task<PrinterInfo[]> GetPrintersInfo(string printerName = "", PrinterIcon printerIcon = PrinterIcon.None, bool spoolerOnly = false, bool useFastLane = true)
Parameters
Type Name Description
System.String printerName

The printer name. If empty, all available printers info will be returned.

PrinterIcon printerIcon

The printer icon size.

System.Boolean spoolerOnly

If true, only the info available from the OS print spooler is returned (faster; the printer driver is not queried). Default is false.

System.Boolean useFastLane

If true (default), the fast lane connection is used when it's open (see StartFastLane); otherwise the main connection is used.

Returns
Type Description
System.Threading.Tasks.Task<PrinterInfo[]>

The detailed info of each installed printer in the client system.

GetScanners()

Gets the list of scanner devices available in the client system.

Declaration
public Task<string[]> GetScanners()
Returns
Type Description
System.Threading.Tasks.Task<System.String[]>

The list of scanner devices available in the client system.

GetScannersInfo(String)

Gets detailed info of each installed scanner in the client system.

Declaration
public Task<ScannerInfo[]> GetScannersInfo(string scannerName = "")
Parameters
Type Name Description
System.String scannerName

The scanner name. If empty, all available scanners info will be returned.

Returns
Type Description
System.Threading.Tasks.Task<ScannerInfo[]>

The detailed info of each installed scanner in the client system.

GetSerialPorts()

Gets the list of Serial ports available in the client system.

Declaration
public Task<string[]> GetSerialPorts()
Returns
Type Description
System.Threading.Tasks.Task<System.String[]>

The list of Serial ports available in the client system.

GetSessionCertificate()

Gets the Session Certificated.

Declaration
public Task<SessionCertificate> GetSessionCertificate()
Returns
Type Description
System.Threading.Tasks.Task<SessionCertificate>

The Session Certificated.

GetSystemFonts()

Gets the list of fonts name available in the client system.

Declaration
public Task<string[]> GetSystemFonts()
Returns
Type Description
System.Threading.Tasks.Task<System.String[]>

The list of fonts name available in the client system.

GetTrays(String)

Gets the supported trays for a given printer.

Declaration
public Task<TraysInfo> GetTrays(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

Returns
Type Description
System.Threading.Tasks.Task<TraysInfo>

The supported trays for a given printer.

GetUsbDevices()

Gets the list of USB devices available in the client system.

Declaration
public Task<UsbDevice[]> GetUsbDevices()
Returns
Type Description
System.Threading.Tasks.Task<UsbDevice[]>

The list of USB devices available in the client system.

GetUserName()

Gets the system user name.

Declaration
public Task<string> GetUserName()
Returns
Type Description
System.Threading.Tasks.Task<System.String>

The system user name.

GetVideoDevices()

Gets the list of video input devices available in the client system.

Declaration
public Task<string[]> GetVideoDevices()
Returns
Type Description
System.Threading.Tasks.Task<System.String[]>

The list of video input devices available in the client system.

GetWorkerInstance(Boolean, String, Int32)

Gets a Worker Instance of the JSPrintManager Client App.

Declaration
public Task<object> GetWorkerInstance(bool useSecureWS = true, string ipAddress = "localhost", int port = 29443)
Parameters
Type Name Description
System.Boolean useSecureWS

Whether to use Secure WebSocket connection. Default is true.

System.String ipAddress

The IP address of the print server.

System.Int32 port

The custom port when using white label license.

Returns
Type Description
System.Threading.Tasks.Task<System.Object>

The Worker Instance info.

OpenBTComm(BTComm)

Opens a Bluetooth comm.

Declaration
public void OpenBTComm(BTComm btComm)
Parameters
Type Name Description
BTComm btComm

OpenHIDComm(HIDComm)

Opens a HID comm.

Declaration
public void OpenHIDComm(HIDComm hidComm)
Parameters
Type Name Description
HIDComm hidComm

OpenSerialComm(SerialComm)

Opens a serial comm.

Declaration
public void OpenSerialComm(SerialComm serialComm)
Parameters
Type Name Description
SerialComm serialComm

OpenTcpComm(TcpComm)

Opens a TCP/IP comm.

Declaration
public void OpenTcpComm(TcpComm tcpComm)
Parameters
Type Name Description
TcpComm tcpComm

OpenUSBComm(USBComm)

Opens a USB comm.

Declaration
public void OpenUSBComm(USBComm usbComm)
Parameters
Type Name Description
USBComm usbComm

PrinterDeleteAllJobs(String)

Delete all print jobs in the specified printer queue.

Declaration
public void PrinterDeleteAllJobs(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

RefreshPrinters()

Refreshes the printers list in the JSPrintManager Client App.

Declaration
public Task<object> RefreshPrinters()
Returns
Type Description
System.Threading.Tasks.Task<System.Object>

The result of the RefreshPrinters operation.

SendClientPrintJob(ClientPrintJob)

Sends a ClientPrintJob to the client system.

Declaration
public void SendClientPrintJob(ClientPrintJob clientPrintJob)
Parameters
Type Name Description
ClientPrintJob clientPrintJob

The ClientPrintJob.

SendClientPrintJob(List<ClientPrintJob>)

Sends a group of ClientPrintJob objects to the client system.

Declaration
public void SendClientPrintJob(List<ClientPrintJob> clientPrintJobGroup)
Parameters
Type Name Description
System.Collections.Generic.List<ClientPrintJob> clientPrintJobGroup

The group of ClientPrintJob objects.

SendClientPrintJobAsync(ClientPrintJob)

Sends a ClientPrintJob to the client system asynchronously.

Declaration
public ValueTask SendClientPrintJobAsync(ClientPrintJob clientPrintJob)
Parameters
Type Name Description
ClientPrintJob clientPrintJob

The ClientPrintJob.

Returns
Type Description
ValueTask

SendClientPrintJobAsync(List<ClientPrintJob>)

Sends a group of ClientPrintJob objects to the client system asynchronously.

Declaration
public ValueTask SendClientPrintJobAsync(List<ClientPrintJob> clientPrintJobGroup)
Parameters
Type Name Description
System.Collections.Generic.List<ClientPrintJob> clientPrintJobGroup

The group of ClientPrintJob objects.

Returns
Type Description
ValueTask

SendClientScanJob(ClientScanJob)

Sends a ClientScanJob to the client system.

Declaration
public void SendClientScanJob(ClientScanJob csj)
Parameters
Type Name Description
ClientScanJob csj

The ClientScanJob.

SendClientScanJobAsync(ClientScanJob)

Sends a ClientScanJob to the client system asynchronously.

Declaration
public ValueTask SendClientScanJobAsync(ClientScanJob csj)
Parameters
Type Name Description
ClientScanJob csj

The ClientScanJob.

Returns
Type Description
ValueTask

SendClientVideoScanJob(ClientVideoScanJob)

Sends a ClientVideoScanJob to the client system.

Declaration
public void SendClientVideoScanJob(ClientVideoScanJob cvsj)
Parameters
Type Name Description
ClientVideoScanJob cvsj

The ClientVideoScanJob.

SendClientVideoScanJobAsync(ClientVideoScanJob)

Sends a ClientVideoScanJob to the client system asynchronously.

Declaration
public ValueTask SendClientVideoScanJobAsync(ClientVideoScanJob cvsj)
Parameters
Type Name Description
ClientVideoScanJob cvsj

The ClientVideoScanJob.

Returns
Type Description
ValueTask

SendDataBTComm(BTComm)

Sends data through a Bluetooth comm.

Declaration
public void SendDataBTComm(BTComm btComm)
Parameters
Type Name Description
BTComm btComm

SendDataHIDComm(HIDComm)

Sends data through a HID comm.

Declaration
public void SendDataHIDComm(HIDComm hidComm)
Parameters
Type Name Description
HIDComm hidComm

SendDataSerialComm(SerialComm)

Sends data through a serial comm.

Declaration
public void SendDataSerialComm(SerialComm serialComm)
Parameters
Type Name Description
SerialComm serialComm

SendDataTcpComm(TcpComm)

Sends data through a TCP/IP comm.

Declaration
public void SendDataTcpComm(TcpComm tcpComm)
Parameters
Type Name Description
TcpComm tcpComm

SendDataUSBComm(USBComm)

Sends data through a USB comm.

Declaration
public void SendDataUSBComm(USBComm usbComm)
Parameters
Type Name Description
USBComm usbComm

SendIppMessage(String, String, Byte[], String, String)

Sends an IPP Message.

Declaration
public Task<object> SendIppMessage(string deviceUri, string ippMessage, byte[] fileContent = null, string userName = "", string password = "")
Parameters
Type Name Description
System.String deviceUri

The IPP device URI.

System.String ippMessage

The IPP JSON Message.

System.Byte[] fileContent

The file binary content (if required).

System.String userName

The user name (if required).

System.String password

The password (if required).

Returns
Type Description
System.Threading.Tasks.Task<System.Object>

An IPP Message Response.

SetBluetoothDevices(BluetoothDevice[])

Declaration
public void SetBluetoothDevices(BluetoothDevice[] btDevices)
Parameters
Type Name Description
BluetoothDevice[] btDevices

SetBTCommEvent(BTCommEvent)

Declaration
public void SetBTCommEvent(BTCommEvent btCommEvent)
Parameters
Type Name Description
BTCommEvent btCommEvent

SetClientAppInfo(String)

Declaration
public void SetClientAppInfo(string clientAppInfo)
Parameters
Type Name Description
System.String clientAppInfo

SetClientAppInstances(String)

Declaration
public void SetClientAppInstances(string clientAppInstances)
Parameters
Type Name Description
System.String clientAppInstances

SetClientMAC(String)

Declaration
public void SetClientMAC(string clientMAC)
Parameters
Type Name Description
System.String clientMAC

SetClientPrintJobStatusChanged(PrintJobStatus)

Declaration
public void SetClientPrintJobStatusChanged(PrintJobStatus jobStatus)
Parameters
Type Name Description
PrintJobStatus jobStatus

SetClientScanJobStatusChanged(ScanJobStatus)

Declaration
public void SetClientScanJobStatusChanged(ScanJobStatus jobStatus)
Parameters
Type Name Description
ScanJobStatus jobStatus

SetClientVideoScanJobStatusChanged(ScanJobStatus)

Declaration
public void SetClientVideoScanJobStatusChanged(ScanJobStatus jobStatus)
Parameters
Type Name Description
ScanJobStatus jobStatus

SetDefaultPaperName(String)

Declaration
public void SetDefaultPaperName(string defaultPaperName)
Parameters
Type Name Description
System.String defaultPaperName

SetDefaultTrayName(String)

Declaration
public void SetDefaultTrayName(string defaultTrayName)
Parameters
Type Name Description
System.String defaultTrayName

SetDeviceId(String)

Declaration
public void SetDeviceId(string deviceId)
Parameters
Type Name Description
System.String deviceId

SetError(String)

Declaration
public void SetError(string error)
Parameters
Type Name Description
System.String error

SetHIDCommEvent(HIDCommEvent)

Declaration
public void SetHIDCommEvent(HIDCommEvent hidCommEvent)
Parameters
Type Name Description
HIDCommEvent hidCommEvent

SetHidDevices(HidDevice[])

Declaration
public void SetHidDevices(HidDevice[] hidDevices)
Parameters
Type Name Description
HidDevice[] hidDevices

SetIppMessage(Object)

Declaration
public void SetIppMessage(object ippMessageResponse)
Parameters
Type Name Description
System.Object ippMessageResponse

SetLicenseValidated(Boolean, String)

Declaration
public void SetLicenseValidated(bool isValid, string licenseState)
Parameters
Type Name Description
System.Boolean isValid
System.String licenseState

SetMediaTypes(MediaTypesInfo)

Declaration
public void SetMediaTypes(MediaTypesInfo mediaTypes)
Parameters
Type Name Description
MediaTypesInfo mediaTypes

SetPaperInfo(String)

Declaration
public void SetPaperInfo(string paperInfo)
Parameters
Type Name Description
System.String paperInfo

SetPapers(PapersInfo)

Declaration
public void SetPapers(PapersInfo papers)
Parameters
Type Name Description
PapersInfo papers

SetPrinters(String[])

Declaration
public void SetPrinters(string[] printers)
Parameters
Type Name Description
System.String[] printers

SetPrintersEvent(PrinterEvent)

Declaration
public void SetPrintersEvent(PrinterEvent printerEvent)
Parameters
Type Name Description
PrinterEvent printerEvent

SetPrintersInfo(PrinterInfo[])

Declaration
public void SetPrintersInfo(PrinterInfo[] printersInfo)
Parameters
Type Name Description
PrinterInfo[] printersInfo

SetRefreshPrinters(Object)

Declaration
public void SetRefreshPrinters(object result)
Parameters
Type Name Description
System.Object result

SetScanners(String[])

Declaration
public void SetScanners(string[] scanners)
Parameters
Type Name Description
System.String[] scanners

SetScannersInfo(ScannerInfo[])

Declaration
public void SetScannersInfo(ScannerInfo[] scannersInfo)
Parameters
Type Name Description
ScannerInfo[] scannersInfo

SetSerialCommEvent(SerialCommEvent)

Declaration
public void SetSerialCommEvent(SerialCommEvent serialCommEvent)
Parameters
Type Name Description
SerialCommEvent serialCommEvent

SetSerialPorts(String[])

Declaration
public void SetSerialPorts(string[] serialPorts)
Parameters
Type Name Description
System.String[] serialPorts

SetSessionCertificate(SessionCertificate)

Declaration
public void SetSessionCertificate(SessionCertificate cert)
Parameters
Type Name Description
SessionCertificate cert

SetShowAbout(Object)

Declaration
public void SetShowAbout(object result)
Parameters
Type Name Description
System.Object result

SetStatus(JSPMWSStatus)

Declaration
public void SetStatus(JSPMWSStatus status)
Parameters
Type Name Description
JSPMWSStatus status

SetStatusInfo(WSStatusInfo)

Declaration
public void SetStatusInfo(WSStatusInfo info)
Parameters
Type Name Description
WSStatusInfo info

SetSystemFonts(String[])

Declaration
public void SetSystemFonts(string[] sysFonts)
Parameters
Type Name Description
System.String[] sysFonts

SetTcpCommEvent(TcpCommEvent)

Declaration
public void SetTcpCommEvent(TcpCommEvent tcpCommEvent)
Parameters
Type Name Description
TcpCommEvent tcpCommEvent

SetTrays(TraysInfo)

Declaration
public void SetTrays(TraysInfo trays)
Parameters
Type Name Description
TraysInfo trays

SetUpdateClient(Object)

Declaration
public void SetUpdateClient(object result)
Parameters
Type Name Description
System.Object result

SetUSBCommEvent(USBCommEvent)

Declaration
public void SetUSBCommEvent(USBCommEvent usbCommEvent)
Parameters
Type Name Description
USBCommEvent usbCommEvent

SetUsbDevices(UsbDevice[])

Declaration
public void SetUsbDevices(UsbDevice[] usbDevices)
Parameters
Type Name Description
UsbDevice[] usbDevices

SetUserName(String)

Declaration
public void SetUserName(string userName)
Parameters
Type Name Description
System.String userName

SetVideoDevices(String[])

Declaration
public void SetVideoDevices(string[] videoDevices)
Parameters
Type Name Description
System.String[] videoDevices

SetWorkerInstance(Object)

Declaration
public void SetWorkerInstance(object workerInstance)
Parameters
Type Name Description
System.Object workerInstance

ShowAbout()

Shows the About dialog of the JSPrintManager Client App.

Declaration
public Task<object> ShowAbout()
Returns
Type Description
System.Threading.Tasks.Task<System.Object>

The result of the ShowAbout operation.

SitesManager(String, SitesManagerAction)

Allows or Blocks a given site address in the client device.

Declaration
public void SitesManager(string site, SitesManagerAction action)
Parameters
Type Name Description
System.String site

The site address.

SitesManagerAction action

The action to perform with the specified site address.

Remarks

IMPORTANT: the origin that makes this request must be in the ALLOW list of the client device!

Start(String, Int32, String, Boolean, String, Boolean, String)

Starts a WebSocket communication with the JSPrintManager Client App.

Declaration
public void Start(string licenseURL = "", int port = 29443, string ipAddress = "127.0.0.1", bool autoReconnect = true, string licenseAuthorizationHeader = "", bool useSecureWS = true, string licenseCustomHeaders = "")
Parameters
Type Name Description
System.String licenseURL

The URL to get the license info. If not specified, then ORIGIN/jspm will be used.

System.Int32 port

The custom port when using white label license.

System.String ipAddress

The IP address of the print server.

System.Boolean autoReconnect

If the websocket have closed, then retry to reconnect automatically.

System.String licenseAuthorizationHeader

The Authorization HTTP Header to be sent to the license controller.

System.Boolean useSecureWS

Whether to use Secure WebSocket connection. Default is true.

System.String licenseCustomHeaders

Any custom HTTP headers to be sent to the license controller. Each custom header must be on a new line(\n) and follow the 'Name: Value' format.

Remarks

If a previous Start() ended with NotInstalled, CertificateError, ConnectionError or SslModeMismatch, calling Start() again retries the connection (e.g. Start(useSecureWS: false) when the Client App has SSL disabled). See CloseReason for the failure details.

StartFastLane(Boolean, String, Int32, Int32)

Opens a secondary "fast lane" WebSocket to the Client App, used for printer queries (GetPrinters, GetPrintersInfo) so they are not queued behind long running jobs on the main connection.

Declaration
public Task<JSPMWSStatus> StartFastLane(bool useSecureWS, string ipAddress, int port = 29443, int timeoutMs = 15000)
Parameters
Type Name Description
System.Boolean useSecureWS

Whether to use Secure WebSocket connection.

System.String ipAddress

The IP address of the print server.

System.Int32 port

The custom port when using white label license.

System.Int32 timeoutMs

Max milliseconds to wait for the fast lane to open. Default is 15000.

Returns
Type Description
System.Threading.Tasks.Task<JSPMWSStatus>

The fast lane status. Open on success. Closed if the main connection is not open yet.

StartFastLane(Int32)

Opens a secondary "fast lane" WebSocket to the Client App, used for printer queries (GetPrinters, GetPrintersInfo) so they are not queued behind long running jobs on the main connection. The ws/wss mode, IP address and port of the last Start() call are used.

Declaration
public Task<JSPMWSStatus> StartFastLane(int timeoutMs = 15000)
Parameters
Type Name Description
System.Int32 timeoutMs

Max milliseconds to wait for the fast lane to open. Default is 15000.

Returns
Type Description
System.Threading.Tasks.Task<JSPMWSStatus>

The fast lane status. Open on success. Closed if the main connection is not open yet.

StartPrintersWatcher()

Starts the printers watcher for handling any printer-related events.

Declaration
public void StartPrintersWatcher()

Stop()

Stops the WebSocket communication with the JSPrintManager Client App.

Declaration
public void Stop()

TryGetBluetoothDevices()

Tries to get detailed info of each Bluetooth device in the client system.

Declaration
public void TryGetBluetoothDevices()

TryGetClientAppInfo(Int32)

Tries to get the Client App info.

Declaration
public void TryGetClientAppInfo(int port = 29443)
Parameters
Type Name Description
System.Int32 port

The custom port when using white label license.

TryGetClientAppInstances(Int32)

Tries to get the Client App instances.

Declaration
public void TryGetClientAppInstances(int port = 29443)
Parameters
Type Name Description
System.Int32 port

The custom port when using white label license.

TryGetClientMAC()

Tries to get the Media Access Control (MAC) address of the client system.

Declaration
public void TryGetClientMAC()

TryGetDefaultPaperName(String)

Tries to get the default paper name for a given printer.

Declaration
public void TryGetDefaultPaperName(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

TryGetDefaultTrayName(String)

Tries to get the default tray name for a given printer.

Declaration
public void TryGetDefaultTrayName(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

TryGetDeviceId()

Tries to get the device ID.

Declaration
public void TryGetDeviceId()

TryGetHidDevices()

Tries to get the list of HID devices available in the client system.

Declaration
public void TryGetHidDevices()

TryGetMediaTypes(String)

Tries to get the supported media types for a given printer.

Declaration
public void TryGetMediaTypes(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

TryGetPaperInfo(String, String)

Tries to get the Paper info for a given printer.

Declaration
public void TryGetPaperInfo(string printerName, string paperName)
Parameters
Type Name Description
System.String printerName

The printer name.

System.String paperName

The paper name.

TryGetPapers(String)

Tries to get the supported papers for a given printer.

Declaration
public void TryGetPapers(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

TryGetPrinters(Boolean, Boolean)

Tries to get the list of installed printers in the client system.

Declaration
public void TryGetPrinters(bool localsOnly = false, bool useFastLane = true)
Parameters
Type Name Description
System.Boolean localsOnly

If true, then local printers only will be listed. Default is false.

System.Boolean useFastLane

If true (default), the fast lane connection is used when it's open (see StartFastLane); otherwise the main connection is used.

TryGetPrintersInfo(String, PrinterIcon, Boolean, Boolean)

Tries to get detailed info of each installed printer in the client system.

Declaration
public void TryGetPrintersInfo(string printerName = "", PrinterIcon printerIcon = PrinterIcon.None, bool spoolerOnly = false, bool useFastLane = true)
Parameters
Type Name Description
System.String printerName

The printer name. If empty, all available printers info will be returned.

PrinterIcon printerIcon

The printer icon size.

System.Boolean spoolerOnly

If true, only the info available from the OS print spooler is returned (faster; the printer driver is not queried). Default is false.

System.Boolean useFastLane

If true (default), the fast lane connection is used when it's open (see StartFastLane); otherwise the main connection is used.

TryGetScanners()

Tries to get the list of scanner devices available in the client system.

Declaration
public void TryGetScanners()

TryGetScannersInfo(String)

Tries to get detailed info of each installed scanner in the client system.

Declaration
public void TryGetScannersInfo(string scannerName = "")
Parameters
Type Name Description
System.String scannerName

The scanner name. If empty, all available scanners info will be returned.

TryGetSerialPorts()

Tries to get the list of Serial ports available in the client system.

Declaration
public void TryGetSerialPorts()

TryGetSessionCertificate()

Tries to get the Session Certificated.

Declaration
public void TryGetSessionCertificate()

TryGetSystemFonts()

Tries to get the list of fonts name available in the client system.

Declaration
public void TryGetSystemFonts()

TryGetTrays(String)

Tries to get the supported trays for a given printer.

Declaration
public void TryGetTrays(string printerName)
Parameters
Type Name Description
System.String printerName

The printer name.

TryGetUsbDevices()

Tries to get the list of USB devices available in the client system.

Declaration
public void TryGetUsbDevices()

TryGetUserName()

Tries to get the system user name.

Declaration
public void TryGetUserName()

TryGetVideoDevices()

Tries to get the list of video input devices available in the client system.

Declaration
public void TryGetVideoDevices()

TryGetWorkerInstance(Boolean, String, Int32)

Tries to get a Worker Instance of the JSPrintManager Client App.

Declaration
public void TryGetWorkerInstance(bool useSecureWS = true, string ipAddress = "localhost", int port = 29443)
Parameters
Type Name Description
System.Boolean useSecureWS

Whether to use Secure WebSocket connection. Default is true.

System.String ipAddress

The IP address of the print server.

System.Int32 port

The custom port when using white label license.

TryRefreshPrinters()

Tries to refresh the printers list in the JSPrintManager Client App.

Declaration
public void TryRefreshPrinters()

TrySendIppMessage(String, String, Byte[], String, String)

Tries to send an IPP Message.

Declaration
public void TrySendIppMessage(string deviceUri, string ippMessage, byte[] fileContent = null, string userName = "", string password = "")
Parameters
Type Name Description
System.String deviceUri

The IPP device URI.

System.String ippMessage

The IPP JSON Message.

System.Byte[] fileContent

The file binary content (if required).

System.String userName

The user name (if required).

System.String password

The password (if required).

TryShowAbout()

Tries to show the About dialog of the JSPrintManager Client App.

Declaration
public void TryShowAbout()

TryUpdateClient()

Tries to update the JSPrintManager Client App.

Declaration
public void TryUpdateClient()

UnsubscribePrinterEvent(String)

Unsubscribes from a printer event subscription.

Declaration
public void UnsubscribePrinterEvent(string subscriptionId)
Parameters
Type Name Description
System.String subscriptionId

The subscription ID returned by the printer event (onPrinterCreated, onPrinterUpdated, onPrinterDeleted).

UpdateClient()

Updates the JSPrintManager Client App.

Declaration
public Task<object> UpdateClient()
Returns
Type Description
System.Threading.Tasks.Task<System.Object>

The result of the UpdateClient operation.

WhenLicensed(Int32)

Waits until the Client App finishes validating the license of the current connection.

Declaration
public Task<bool> WhenLicensed(int timeoutMs = 0)
Parameters
Type Name Description
System.Int32 timeoutMs

Max milliseconds to wait. Zero (default) waits until the library itself settles the validation (see LicenseTimeoutMs).

Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

True if the license is valid; false if it's invalid, the validation timed out, or there is no connection.

Events

OnBTCommEvent

Occurs when any Bluetooth comm event happens.

Declaration
public event Action OnBTCommEvent
Event Type
Type Description
System.Action

OnClientPrintJobStatusChanged

Occurs when a ClientPrintJob status changes.

Declaration
public event Action OnClientPrintJobStatusChanged
Event Type
Type Description
System.Action

OnClientScanJobStatusChanged

Occurs when a ClientScanJob status changes.

Declaration
public event Action OnClientScanJobStatusChanged
Event Type
Type Description
System.Action

OnClientVideoScanJobStatusChanged

Occurs when a ClientVideoScanJob status changes.

Declaration
public event Action OnClientVideoScanJobStatusChanged
Event Type
Type Description
System.Action

OnError

Occurs when an error is thrown.

Declaration
public event Action OnError
Event Type
Type Description
System.Action

OnGetBluetoothDevices

Occurs when the detailed info of each Bluetooth device is obtained.

Declaration
public event Action OnGetBluetoothDevices
Event Type
Type Description
System.Action

OnGetClientAppInfo

Occurs when the Client App info is obtained.

Declaration
public event Action OnGetClientAppInfo
Event Type
Type Description
System.Action

OnGetClientAppInstances

Occurs when the Client App instances are obtained.

Declaration
public event Action OnGetClientAppInstances
Event Type
Type Description
System.Action

OnGetClientMAC

Occurs when the Media Access Control (MAC) address of the client system is obtained.

Declaration
public event Action OnGetClientMAC
Event Type
Type Description
System.Action

OnGetDefaultPaperName

Occurs when the default paper name for a given printer is obtained.

Declaration
public event Action OnGetDefaultPaperName
Event Type
Type Description
System.Action

OnGetDefaultTrayName

Occurs when the default tray name for a given printer is obtained.

Declaration
public event Action OnGetDefaultTrayName
Event Type
Type Description
System.Action

OnGetDeviceId

Occurs when the device ID is obtained.

Declaration
public event Action OnGetDeviceId
Event Type
Type Description
System.Action

OnGetHidDevices

Occurs when the list of HID devices is obtained.

Declaration
public event Action OnGetHidDevices
Event Type
Type Description
System.Action

OnGetIppMessageResponse

Occurs when an IPP Message response is received.

Declaration
public event Action OnGetIppMessageResponse
Event Type
Type Description
System.Action

OnGetMediaTypes

Occurs when the supported media types for a given printer is obtained.

Declaration
public event Action OnGetMediaTypes
Event Type
Type Description
System.Action

OnGetPaperInfo

Occurs when the Paper info for a given printer and paper is obtained.

Declaration
public event Action OnGetPaperInfo
Event Type
Type Description
System.Action

OnGetPapers

Occurs when the supported papers for a given printer is obtained.

Declaration
public event Action OnGetPapers
Event Type
Type Description
System.Action

OnGetPrinters

Occurs when the list of installed printers is obtained.

Declaration
public event Action OnGetPrinters
Event Type
Type Description
System.Action

OnGetPrintersInfo

Occurs when the detailed info of each installed printer is obtained.

Declaration
public event Action OnGetPrintersInfo
Event Type
Type Description
System.Action

OnGetScanners

Occurs when the list of scanner devices available in the client system is obtained.

Declaration
public event Action OnGetScanners
Event Type
Type Description
System.Action

OnGetScannersInfo

Occurs when the detailed info of each installed scanner is obtained.

Declaration
public event Action OnGetScannersInfo
Event Type
Type Description
System.Action

OnGetSerialPorts

Occurs when the list of Serial ports available in the client system is obtained.

Declaration
public event Action OnGetSerialPorts
Event Type
Type Description
System.Action

OnGetSessionCertificate

Occurs when the Session Certificated is obtained.

Declaration
public event Action OnGetSessionCertificate
Event Type
Type Description
System.Action

OnGetSystemFonts

Occurs when the list of fonts name available in the client system is obtained.

Declaration
public event Action OnGetSystemFonts
Event Type
Type Description
System.Action

OnGetTrays

Occurs when the supported trays for a given printer is obtained.

Declaration
public event Action OnGetTrays
Event Type
Type Description
System.Action

OnGetUsbDevices

Occurs when the list of USB devices is obtained.

Declaration
public event Action OnGetUsbDevices
Event Type
Type Description
System.Action

OnGetUserName

Occurs when the system user name is obtained.

Declaration
public event Action OnGetUserName
Event Type
Type Description
System.Action

OnGetVideoDevices

Occurs when the list of video input devices is obtained.

Declaration
public event Action OnGetVideoDevices
Event Type
Type Description
System.Action

OnGetWorkerInstance

Occurs when the Worker Instance info is obtained.

Declaration
public event Action OnGetWorkerInstance
Event Type
Type Description
System.Action

OnHIDCommEvent

Occurs when any HID comm event happens.

Declaration
public event Action OnHIDCommEvent
Event Type
Type Description
System.Action

OnLicenseValidated

Occurs when the Client App finishes validating the license (valid, invalid or timeout).

Declaration
public event Action OnLicenseValidated
Event Type
Type Description
System.Action

OnPrintersEvent

Occurs when any Printers event happens.

Declaration
public event Action OnPrintersEvent
Event Type
Type Description
System.Action

OnRefreshPrinters

Occurs when the RefreshPrinters result is obtained.

Declaration
public event Action OnRefreshPrinters
Event Type
Type Description
System.Action

OnSerialCommEvent

Occurs when any serial comm event happens.

Declaration
public event Action OnSerialCommEvent
Event Type
Type Description
System.Action

OnShowAbout

Occurs when the ShowAbout result is obtained.

Declaration
public event Action OnShowAbout
Event Type
Type Description
System.Action

OnStatusChanged

Occurs when the JSPrintManager WebSocket status changes.

Declaration
public event Action OnStatusChanged
Event Type
Type Description
System.Action

OnTcpCommEvent

Occurs when any TCP/IP comm event happens.

Declaration
public event Action OnTcpCommEvent
Event Type
Type Description
System.Action

OnUpdateClient

Occurs when the UpdateClient result is obtained.

Declaration
public event Action OnUpdateClient
Event Type
Type Description
System.Action

OnUSBCommEvent

Occurs when any USB comm event happens.

Declaration
public event Action OnUSBCommEvent
Event Type
Type Description
System.Action
Back to top Copyright © 2003- Neodynamic SRL
www.neodynamic.com