Several methods of implementing terminal printing under UNIX

xiaoxiao2021-03-06  17

At present, most of the domestic banking industry computer application systems use terminal business data to enter, business data printing, with end-end business processing on UNIX operating system platforms. The author describes several ways to implement terminal printing under UNIX: 1. Overview The terminal printing under the UNIX environment is supported by the operating system, using the function provided by the terminal, with the command or program to implement the terminal print. The specific process is: performing the print control command on the terminal to enable the terminal into the print state, and notify the printer ready to prepare, enter the file name to print files on the terminal to print. After printing, execute the print control command on the terminal to exit the print state. Second, printing method 1. Print with the hotkey function provided by the terminal itself. Various types of terminals provide the user with the printing hotkey. Just press the printing hotkey terminal to enter the print state, usually use the CAT command to print the file name to print file, print, then press the print hot button You can exit the print state. If the copy print hot button of the HT-382 series terminal is Ctrl-F2.2. Use the shell command to implement the terminal print. The UNIX operating system provides an interactive interpretation command language shell that can easily implement terminal printing. First, find the control command of the terminal print, and also take the HT-382 series terminal as an example, enter the copy print control command is ESC [5i, exiting the copy print control command is ESC [4i. Available VI to edit a shell command print file as follows: Echo 'ESC [5i' # Terminal Enter Print Status Cat $ 1 # Print File

Echo 'ESC [4i' # terminal exits the print state on the terminal or performs this shell print command in the program, and then keeps the file name to print the file. 3. Use the C language to implement the terminal print. Also use the HT-382 series terminal as an example, write the terminal print program with the C language as follows:

#Include main (argc, argv) int ARGC; charargv [] {char {N; Printf ("/ 033 / [/ 5 / i"); /  Terminal enters print status  / SPRINTF (N "CAT% S", Argv [0]); /  feed print file name  / system (n); /  print file  / printf ("/ 033 / [/ 5 / i"); /  The terminal exits the print state  /} Simply print the file name to print the file after this program is used in use. Third, a few more note 1. Terminal printing should be set to the terminal settings in the terminal settings to the terminal connection print type. 2. Terminal printing can select the screen print according to the business requirements (only print screen display content), copy print (side-screen display file content), transparent print (print, no file content). 3. SHELL print command, the editing of the escape character ESC should press the CTRL-V key first, then press the ESC key to write. 4. Concluding the characters in the language print program, use 8 credit, and the front plus the sense character "/". For example, the ESC 8 credit ASCII code is 33, and "/ 033" is written in the program.

转载请注明原文地址:https://www.9cbs.com/read-45176.html

New Post(0)