Advanced Printer Driver Sample Program


Registering/Printing NV Graphics

Registers a stylized bitmap such as a shop logo in the NV memory (nonvolatile memory) of the TM printer and prints it at the top of receipts.

Registering NV Graphics

Registers bitmap data in the NV memory (Keycode: 48,48) of the TM printer with the utility corresponding to the device.

Printing

Prints the bitmap data registered in NV Graphics 0, using "h" of control font.

Win32 Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program10\ .exe .exe

.NET Environment

In .NET environment, you cannot specify a control font in the TM printer directly.
You need replace fonts. For details on how to replace fonts, see "Step1 Printing Device Font."

TrueTypeFont Device Font Name
Consolas control

With this sample program, NV graphic data is created in 1.5-point Consolas, which is converted into a control device font to print NV graphics.

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
VB.NET Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program10\ .exe .exe
Top

Monitoring Status, Controlling Jobs

Monitors the printer status and cancels jobs when a paper end error occurs.

Win32 Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program11\ .exe .exe

.NET Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C# Source folder [Expanded folder]\Sample\Src\C#\SingleFunction\Program11\ .exe .exe
VB.NET Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program11\ .exe .exe
Top

Maintenance Counter

Obtains the maintenance counter such as the number of paper feeding lines or operating time, using BiGetCounter of Status API.
Some models do not support this function.
Use BiResetCounter to reset the maintenance counter.

Win32 Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program12\ .exe .exe

.NET Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C# Source folder [Expanded folder]\Sample\Src\C#\SingleFunction\Program12\ .exe .exe
VB.NET Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program12\ .exe .exe
Top

Occupying Shared Printer

Occupies a shared printer, using Status API.
When the printer is used in multiple processes such as being used by more than one user, you can avoid conflict with other processes by controlling priorities.

Win32 Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program14\ .exe .exe

.NET Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C# Source folder [Expanded folder]\Sample\Src\C#\SingleFunction\Program14\ .exe .exe
VB.NET Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program14\ .exe .exe
Top

Forced Reset

Note:
This program will force the printer to reset even if printing is in progress, and the data being printed will be deleted.

A forced reset of the printer is performed from this program without closing the [Print Test Page].
If printing is not completed or an error is not obtained within 150 seconds after executing a print job,
this program displays a confirmation message and then performs a forced reset.

Use the following procedure to confirm this operation.
  1. Start this program.
  2. Open the Properties window for the printer, and execute [Print Test Page]. When printing starts, immediately disconnect the printer from the computer.
  3. Wait approximately 90 seconds, and then connect the printer to the computer once again.
  4. Check the printer queue in Windows.
    If the status is "Initializing", the [Print Test Page] operation has not been completed during this process. Proceed to the next step.
    If the status is "Ready", the [Print Test Page] operation has been performed. Start from Step 2 again.
  5. Click the [Print] button in this program.
  6. After 150 seconds, the message [Anomalous occurrence. Execute BiForceResetPrinter.] appears.
  7. Select [Yes]. BiForceResetPrinter is executed, and the TM printer is reset. Then, printing is performed from this program.

Adjust the time (150,000ms for the sample program) as necessary according to the volume of data being printed.

Edited file

Programming Language Source File name Edited locations
Link Storage location
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program16\Program16\ PrintDlg.cpp Line 15
VB.NET Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program16\Program16\ Form1.vb Line 68

Win32 Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program16\ .exe .exe

.NET Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
VB.NET Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program16\ .exe .exe
Top