# 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
> 32 bit | 64 bit
> C++ | Source folder | .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 Printer Settings tab, and set as shown below.

> TrueTypeFont | Device Font Name
> Microsoft Sans Serif | FontA

> This sample program prints FontA11 point with Microsoft Sans Serif 10-point.

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> VB.NET | Source folder | .exe | .exe

Top | Page top

## Step2 Printing Slips (Slip Printer)

Prints with a slip printer.

> Note:
> Specify the slip printer driver to use this sample program.
> You need to feed a slip into a slip printer to start printing unlike a receipt printer.

### Win32 Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> C++ | Source folder | .exe | .exe

### .NET Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> VB.NET | Source folder | .exe | .exe

Top | Page top

## Step3 Printing Barcode

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

> <Setting Barcode Font>
> Go to Printing Preferences of the printer driver, select the Barcode tab, and 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
> 32 bit | 64 bit
> C++ | Source folder | .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
> 32 bit | 64 bit
> VB.NET | Source folder | .exe | .exe

Top | Page top

## Step4 Printing Bitmap Data

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

### Win32 Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> C++ | Source folder | .exe | .exe

### .NET Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> VB.NET | Source folder | .exe | .exe

Top | Page top

## Step5 Status API

In addition to the receipt printing in Step 4, 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
> 32 bit | 64 bit
> C++ | Displays a message of print completion after printing a receipt. | Source folder | .exe | .exe
> Monitors the printer status and processes error handling. | Source folder | .exe | .exe

### .NET Environment

> Programming Language | Explanation | Source | Executable file
> 32 bit | 64 bit
> C# | Displays a message of print completion after printing a receipt. | Source folder | .exe | .exe
> Monitors the printer status and processes error handling. | Source folder | .exe | .exe
> VB.NET | Displays a message of print completion after printing a receipt. | Source folder | .exe | .exe
> Monitors the printer status and processes error handling. | Source folder | .exe | .exe

Top | Page top

## Step6 Callback Process

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

### Win32 Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> C++ | Source folder | .exe | .exe

### .NET Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> C# | Source folder | .exe | .exe
> VB.NET | Source folder | .exe | .exe

Top | Page top

## Step7 Drawer Control

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

### Win32 Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> C++ | Source folder | .exe | .exe

### .NET Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> C# | Source folder | .exe | .exe
> VB.NET | Source folder | .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 7.

### Win32 Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> C++ | Source folder | .exe | .exe
> VB6.0 | Source folder | .exe | --

### .NET Environment

> Programming Language | Source | Executable file
> 32 bit | 64 bit
> C# | Source folder | .exe | .exe
> VB.NET | Source folder | .exe | .exe

Top | Page top