LS Hardware Station Printing App

Because Windows services cannot run external processes (programs) from its service context, the LS Hardware Station service has trouble printing PDF documents. The LS Hardware Station Printing app, which is a separate application, solves this problem. The app does not run as a service, and consequently does not have the same problem as the Hardware Station.

To run the app

Settings and test function

Startup arguments

DeviceID or WindowsPrinterName

To send PDF documents

To run the app

The app is installed with LS Hardware Station. You can find it in the same location as the Hardware Station .exe file, by default at C:\Program Files (x86)\LS Retail\LSHardwareStation\LSHardwareStationPrintingApp.exe.

Like the Hardware Station, you must run the printing app as Administrator. Thanks to Microsoft User Control, you can just double-click the .exe file to run. You can tell that the app is running by the LS Retail logo in the taskbar tray.

This is all you need to start using the app.

Settings and test function

The app has a few settings and a test function. These are available in the app by right-clicking the aforementioned icon:

  • Show Notifications lets you toggle whether notifications are shown when receiving a print job or when there is an error. Notifications are on (default), if the Show Notifications check box is selected.
  • Config Path opens a dialog window where the user can browse to the path of the LS Hardware Station configurations. This is used if printers have been set up in the Hardware Station that the user wishes to use rather than using the Windows printer names.
    The default value is: C:\ProgramData\LS Retail\LS Hardware Station\devices
  • Server Host opens a dialog window where you specify a URL to host the SignalR and WebAPI servers for communication with the app. If you change this option, these servers will attempt to restart with the new URL.
    By default, this is set to http://*:8092 where the asterisk * is a wild card allowing any URLs that can see the app to connect.
  • Print Test PDF is a test function that will simply print a test PDF document to any printer in the list.

A grayed-out line below the options tells the status of the web server. In most cases, the status is Server Status: Running. It will most likely change, if you change the Server Host option and it fails to use the requested URL.

Use the Exit button at the bottom to simply close the app.

Note: All these options revert back to default if you close the app and then open it again. To open the app with the same custom settings each time, use the startup arguments detailed below.

Startup arguments

You can use a few startup arguments to run the printing app with your selected settings, without having to right-click the icon and reenter your settings every time you start the app.

These arguments are also useful for when you want to run the app on startup.

  • To run the with these settings, just write them in the command line after the LSHardwareStationPrintingApp.exe part.

The available startup arguments are:

  • notify - determines whether notifications are shown. notify on its own does nothing, but is followed by an equal sign (=) and an option:

    • notify=all - means all notifications are shown. notifyall also works.
    • notify=none - means no notifications are shown. notifynone also works.
    • notify=error or notify=errors - mean only errors are shown as notifications, not success messages, or other information. notifyerror and notifyerrors also works.
      Note: This setting can only be turned on via startup arguments, not by clicking the setting on the icon. If the setting is turned on, the option on the icon reads Show Notifications (only errors).
      Click the setting to set it to All and it will again toggle between All and None.
  • host - sets the server host of the printing app. The argument is followed by an equal sign (=) and the chosen URL.
    Example: host=http://localhost:8090

  • confpath - sets the path of the LS Hardware Station. The argument is followed by an equal sign (=) and the chosen path.
    Note: if there are spaces in the path, surround the path with double quotes (").
    Example: confpath="C:\Program Files (x86)\LS Retail"

To sum up startup arguments, this example shows how you set up to open the app with only errors showing, with the host URL set to localhost on the port 8090, with ssl turned on, and a config path in the LS Retail folder in program files (x86):
LSHardwareStationPrintingApp.exe notifyerrors host=https://localhost:8090 confpath="C:\Program Files (x86)\LS Retail"

DeviceID or WindowsPrinterName

It may be confusing to some users whether to use a DeviceID or the name of the Windows printer. The answer is that both work. The printing app is meant to work without the user having to do any setup in the Hardware Station, but also to work with the setup that he or she may already have.

This means that the app checks both DeviceName and DeviceID values (in that order) in LS Central. The values are matched against available Windows printers, and if that does not work, the app checks if the values are present as a configuration in the Hardware Station.

Examples:

  • Microsoft Print to PDF would match a Windows printer and thus would print the PDF to another PDF!
  • PRINTER1 would most likely not match any Windows printer. It might, however, be a Hardware Station printer. The app then looks in the config path to see if there is a config where the DeviceID is PRINTER1. The app then reads the config to see what its DeviceName is, and tries to match that against a Windows printer. If that works, the app prints on that particular printer, if not, an error occurs.

To send PDF documents

Similar to LS Hardware Station, the printing app has both SignalR and WebAPI servers to handle requests. Furthermore, the interface is also similar to that of Hardware Station. Both the SignalR and WebAPI servers are on the same host URL and their main function is PrintRaw, similar to the one in WebAPI Printing.

SignalR

The SignalR version uses a PrinterRequest to deliver data to the app. This is the same request that the Hardware Station uses. There are four values (apart from connection settings) that are important when using the PrinterRequest:

  • WindowsPrinterName - the Windows printer name to use instead of DeviceID. This value is checked before the DeviceID.
  • DeviceID - the ID of the device in Hardware Station.
  • PayLoadBase64 - the PDF document to print in base64 format.
  • DocName - the name of the document you wish to use. If left empty, a time stamp is used for document name. This is not so important in the app, since the file is deleted after it has been printed.

WebAPI

The WebAPI version is exactly the same as in Hardware Station, so you can use the steps described in How to: Use Web API Printing.
Note: We recommend using the query string method mentioned in that topic as some printers may have backslashes or other characters that do not work otherwise.