Class JSPrintManager
JSPrintManager allows you to Print Raw Commands and Files, Manage Printers; and Scan Docs from Blazor!
Inheritance
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
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[] |
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> |
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 |
LastErrorMessage
Gets the last error message.
Declaration
public string LastErrorMessage { 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[] |
Scanners
Gets the list of scanner devices available in the client system.
Declaration
public string[] Scanners { get; }
Property Value
Type | Description |
---|---|
System.String[] |
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 |
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[] |
UserName
Gets the system user name.
Declaration
public string UserName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
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 |
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. |
GetClientAppInfo(Int32)
Gets the Client App info.
Declaration
public Task<ClientAppInfo> GetClientAppInfo(int port = 25443)
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 = 25443)
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. |
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<string[]> GetPapers(string printerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | printerName | The printer name. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String[]> | The supported papers for a given printer. |
GetPrinters()
Gets the list of installed printers in the client system.
Declaration
public Task<string[]> GetPrinters()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String[]> | The list of installed printers in the client system. |
GetPrintersInfo(String, PrinterIcon)
Gets detailed info of each installed printer in the client system.
Declaration
public Task<PrinterInfo[]> GetPrintersInfo(string printerName = "", PrinterIcon printerIcon = PrinterIcon.None)
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. |
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. |
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<string[]> GetTrays(string printerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | printerName | The printer name. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String[]> | The supported trays for a given printer. |
GetUserName()
Gets the system user name.
Declaration
public Task<string> GetUserName()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | The system user name. |
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 |
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 |
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 |
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 |
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 |
SetPaperInfo(String)
Declaration
public void SetPaperInfo(string paperInfo)
Parameters
Type | Name | Description |
---|---|---|
System.String | paperInfo |
SetPapers(String[])
Declaration
public void SetPapers(string[] papers)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | 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 |
SetScanners(String[])
Declaration
public void SetScanners(string[] scanners)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | scanners |
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 |
SetStatus(JSPMWSStatus)
Declaration
public void SetStatus(JSPMWSStatus status)
Parameters
Type | Name | Description |
---|---|---|
JSPMWSStatus | status |
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(String[])
Declaration
public void SetTrays(string[] trays)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | trays |
SetUserName(String)
Declaration
public void SetUserName(string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName |
Start(String, Int32)
Starts a WebSocket communication with the JSPrintManager Client App.
Declaration
public void Start(string licenseURL = "", int port = 25443)
Parameters
Type | Name | Description |
---|---|---|
System.String | licenseURL | The URL to get the license info. If not specified, then |
System.Int32 | port | The custom port when using white label license. |
StartPrintersWatcher()
Starts the printers watcher for handling any printer-related events.
Declaration
public void StartPrintersWatcher()
TryGetClientAppInfo(Int32)
Tries to get the Client App info.
Declaration
public void TryGetClientAppInfo(int port = 25443)
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 = 25443)
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. |
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()
Tries to get the list of installed printers in the client system.
Declaration
public void TryGetPrinters()
TryGetPrintersInfo(String, PrinterIcon)
Tries to get detailed info of each installed printer in the client system.
Declaration
public void TryGetPrintersInfo(string printerName = "", PrinterIcon printerIcon = PrinterIcon.None)
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. |
TryGetScanners()
Tries to get the list of scanner devices available in the client system.
Declaration
public void TryGetScanners()
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. |
TryGetUserName()
Tries to get the system user name.
Declaration
public void TryGetUserName()
Events
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 |
OnError
Occurs when an error is thrown.
Declaration
public event Action OnError
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 |
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 |
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 |
OnGetUserName
Occurs when the system user name is obtained.
Declaration
public event Action OnGetUserName
Event Type
Type | Description |
---|---|
System.Action |
OnPrintersEvent
Occurs when any Printers event happens.
Declaration
public event Action OnPrintersEvent
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 |
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 |