Advanced Printer Driver Sample Programs


Step1 Printing Device Font

Prints "Hello APD" with a device font and autocuts a receipt.

Win32 Environment

This sample program uses a device font, FontA11.

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

.NET Environment

In .NET environment, you cannot specify a device font in the TM printer directly.
To print a device font, specify so that a specified TrueType font is replaced by a device font.

<Replacing fonts>
Go to Printing Preferences in the printer driver, select the Advanced Settings tab, and start up the Utility.
Set as shown below.

TrueTypeFont Device Font Name
Lucida Console FontA11
MingLiU FontA22

This sample program prints FontA11 point with Lucida Console 8-point, and FontA22 point wiht MingLiU 19-point.

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

Step2 Printing Barcode

Prints "012345678901" with a barcode on the receipt printed in Step 1.

<Setting Barcode Font>
Go to Printing Preferences in the printer driver, select the Advanced Settings tab, and start up the Utility.
Set as shown below. Set Barcode1.

Setting item Setting
Font Name Barcode1
Type UPC-A
Element Width 3dots
Element Height 162dots
HRI Font No printing

Win32 Environment

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

.NET Environment

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

TrueTypeFont Device Font Name
Courier New Barcode1

With this Sample Program, bar code data is created in 66-Point Courier New, which is converted into Barcode1 device font to print bar codes.

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

Step3 Printing Bitmap Data

Prints bitmap data at the top of the receipt printed in Step 1.
This sample program specifies a bitmap file from the program to print.

Win32 Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program04\ .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\Program04\ .exe .exe
Top
Page top

Step4 Status API

In addition to the receipt printing in Step 3, monitors the printer status (ASB status) and processes error handling.
For details on ASB status, see "Status API Manual."

Win32 Environment

Programming Language Explanation Source Executable file
Link Storage location 32 bit 64 bit
C++
Displays a message of print completion after printing a receipt.
Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program06\ .exe .exe
Monitors the printer status and processes error handling.
Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program07\ .exe .exe

.NET Environment

Programming Language Explanation Source Executable file
Link Storage location 32 bit 64 bit
C#
Displays a message of print completion after printing a receipt.
Source folder [Expanded folder]\Sample\Src\C#\SingleFunction\Program06\ .exe .exe
Monitors the printer status and processes error handling.
Source folder [Expanded folder]\Sample\Src\C#\SingleFunction\Program07\ .exe .exe
VB.NET
Displays a message of print completion after printing a receipt.
Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program06\ .exe .exe
Monitors the printer status and processes error handling.
Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program07\ .exe .exe
Top
Page top

Step5 Callback Process

In addition to the receipt printing in Step 4, processes using the Status API that lets an application automatically obtain the latest printer status.

Win32 Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program08\ .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\Program08\ .exe .exe
VB.NET Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program08\ .exe .exe
Top
Page top

Step6 Drawer Control

After printing the receipt in Step 5, opens a drawer, using the Status API.
This sample program opens the drawer of the 2nd pin.

Win32 Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program09\ .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\Program09\ .exe .exe
VB.NET Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program09\ .exe .exe

You can control the drawer also by APD setting or control font.

Top
Page top

Basic Completion

This is a total program from Steps 1 to 6.

Win32 Environment

Programming Language Source Executable file
Link Storage location 32 bit 64 bit
C++ Source folder [Expanded folder]\Sample\Src\C++\SingleFunction\Program09\ .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\Program09\ .exe .exe
VB.NET Source folder [Expanded folder]\Sample\Src\VBNET\SingleFunction\Program09\ .exe .exe
Top
Page top