Leave a comment at the end of this page or email contact@krishagni.com
Printer Client
Introduction
OpenSpecimen creates print command files that must be transferred to the machine on which printer software is installed, e.g. Bartender, NiceLabel, etc. This poses networking challenges when OpenSpecimen is hosted on a different network than the printer software.
This program uses the REST APIs to download the files from OpenSpecimen every X seconds.
Perquisites
Java 17 installation
A. Windows: Deployment steps | Deploymentsteps Java17changes(Windows)
B. Linux: Deployment steps | Deploymentsteps Java17changes(LinuxandUbuntu)
Configure the printer.properties file
Attribute | Explanation |
---|---|
url | Server url from which you are trying to download the print labels. (e.g. https://test.openspecimen.org) |
username | Username to login with the “Manage Print Jobs” option enabled on the user profile page. It is recommended to create a dedicated user who has no role assigned but only has “Manage Print Jobs” enabled. |
password | Password of the user. |
data_directory | Data directory path to store program data. Default: “./" |
download_directory | Absolute path of the directory where the command files should be created on the printer VM. Default: ./print_labels |
directory_per_design | Values: true/false Default: false Setting indicating whether a different directory should be created for each label type or all files should be placed in the same directory. |
printers | Comma-separated list of printer names. This is useful if you have multiple locations from where you print. Using this you can download files for specific printers. |
polling_interval | Polling interval in seconds to specify how often the server should be checked for the new command files. Default: 60 |
batch_file_download | Either true/false. To download multiple labels into a single file. |
batch_file_format | csv,txt..n. The format of the file. |
batch_file_label_delimiter | This will output ***** between key-value pairs of every label. |
e.g. printer.properties file.
url=<SERVER_URL>
username=<USERNAME>
password=<PASSWORD>
data_dir=./
download_directory=./print-labels
directory_per_design=true
printers=printer1,printer2,printer3,printer4,printer5
polling_interval=60
batch_file_download=true
batch_file_format=csv
batch_file_label_delimiter=*****\n
Downloading jar file: (Email to support@krishagni.com for downloading the jar file)
How to run the program?
Navigate to os-print-client directory.
Configure the printer.properties file.
Command to run the program:
java -Dconf=printer.properties -jar os-printer-client-1.1.0.jar
How to Install as service on windows?
A. Create a batch file:
@echo off
cd <PATH-TO-OS-PRINTER-CLIENT-DIR>
java -Dconf=printer.properties -jar os-printer-client-1.1.0.jar >> <PATH-TO-LOG-FILE> 2>&1
B. Install as a service
Open command prompt, and run the below command to install it as a service.
sc create "OSPrinterClient" binPath= "<BATCH-FILE-PATH>\start_os_printer_client.bat"
Leave a comment at the end of this page or email contact@krishagni.com