My application is a POS system with a single terminal using a single printer. Question is when is it appropriate to call open(), claim() and setDeviceEnabled(true) and setDeviceEnabled(false), release() and close(). Now I do it before and after each print. Should I have it open through multiple prints and release() and close() at the end of the day?
JPOS when to disable, release and close printer
392 views Asked by Dula At
1
It depends on the software structure of the application.
If the application that uses the printer has only one process, execute
Open(),Claim(),DeviceEnabled=Trueonce at application startup. You can executeDeviceEnabled=False,Release(),Close()just before the application terminates.If necessary, the application combines
TransactionPrint(),RotatePrint(),PrintNormal(), etc. to print.This shortens the time it takes for printing.
If applications using printers are running concurrently in more than one process at the same time, only
Open()in each processes.If the process requiring printing remains almost unchanged,
Claim()andDeviceEnabled=Trueon the side of acquiring the control right of the printer simultaneously with the timing of switching of the job and the screen, the side for releasing the control right of the printer WithDeviceEnabled=False,Release()is called.When processes requiring printing change frequently,
Claim(),DeviceEnabled=Trueis executed after every use of the printer occurs, and after printing is completed, when necessary printing is finished,DeviceEnabled=False,Release()to hold.