About the LinePrinter Tools
Honeywell.Mobility.Print.LinePrinter for .NET is an assembly containing tools designed to aid in producing text-based reports. The LinePrinter assembly is designed to work to produce reports on text-based report printers.
Use the LinePrinter tools to:
- produce the text body and change text font styles. The LinePrinter tools include methods for writing text to the printer and manipulating the text, and changing the position of that text on the print media. Font styles supported by the LinePrinter class include bold, compressed, doublewide, italic, strikeout and underline. The command is ignored without generating an error condition if sent to a printer that does not support the requested print mode.
- set up automatic header and footer sections of a report. The LinePrinter class includes two methods for controlling your own footers and headers and for orphan control. You can also specify headers and footers automatically in your report via the FooterEvent and HeaderEvent.
- enable status events to provide information back to the user. Printing status is returned to the application program via the use of status events. These events inform the application program of when the report is started, when each page is started and ended, when the last page is sent to the printer, and when the printer is done printing the report. Not all printers are capable of returning this complete set of information. The page number currently being printed is also available in case it is needed for displaying.
- handle error conditions and exceptions. Error conditions are thrown as exceptions. This allows you to produce your entire report logic in one spot, and handle all errors in another. The only exception that the LinePrinter may throw is the LinePrinterException. If thrown, the exception will contain information that can be used to update the user, or to allow the application to handle the error and continue.
If a printer is capable of returning advanced error and warning information, such as the 6820 using NPCP, you may also be notified of recoverable warnings via the WarningMessageEvent. When this event is received, if you wish to cancel the report, you will need to call the Cancel method from within the event handler. This will cause the recoverable warning to be treated as unrecoverable and will only then generate an exception.
Before Printing
Although the .NET LinePrinter handles most of the printer connection configuration for you, there are a few things that should be done before invoking the LinePrinter.
- To set up for Bluetooth printing, the Bluetooth radio needs to be turned on and the desired Bluetooth enabled printer needs to be selected.
- For serial RS-232 printing, on some mobile computers you need to select the port being used on the computer.
More Information
Next » About the LinePrinter DLLs
Back « Using the LinePrinter Class Contents