0% found this document useful (0 votes)
23 views

Zwin Api

Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Zwin Api

Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 91

Module: ZWIN-CAPI

All commands for PPLZ in Dynamic Link Library for Windows


Notices: Copyright (c) 2001-2013 ARGOX

Notes
1. Where should you put DLL file?
If used 32-bit DLL files:
A.Put DLL files in the same folder with application. (Strongly recommend.)
B.In Windows 32-bit OS, you should put your DLL files into the \Windows\
system32 directory.
C.In Windows 64-bit OS, you should put your DLL files into the \Windows\
SysWOW64 directory.
If used 64-bit DLL files:
A.Put DLL files in the same folder with application. (Strongly recommend.)
B.In Windows 32-bit OS, 64-bit DLL files could not be used.
C.In Windows 64-bit OS, you should put your DLL files into the \Windows\
system32 directory.
2. Examples given below are for Visual C++ and Visual Basic and may not
work with other programming languages or environments.
Table of Contents
Z_GetUSBBufferLen()To search the device name of USB Printer and
return the length of USB Printer data.......................................................................5
Z_EnumUSB()To retrieve the device name of USB Printer.............................5
Z_GetUSBDeviceInfo()To retrieve the device name and device path of
USB Printer...................................................................................................................7
Z_GetNetPrinterBufferLen()To retrieve the device name of Net Printer and
return the length of Net Printer data.......................................................................10
Z_EnumNetPrinter()To retrieve the device name of Net Printer..................10
Z_CreatePrn()To create printer job....................................................................12
Z_CreatePort()To create printer job...................................................................14
Z_CreateUSBPort()To create printer job..........................................................16
Z_CreateNetPort()To create printer job............................................................16
Z_ClosePrn()To close printer job.......................................................................18
Z_Bar2d_Maxi()To print a Maxi Code 2D barcode..........................................19
Z_Bar2d_PDF417()To print a PDF417 2D barcode........................................21
Z_Set_FlashMemory()To set the storage location of Form...........................23
Z_Set_Format_New()To set the name of Form...............................................24
Z_Del_Format()To delete Form..........................................................................25
Z_Del_Graphic()To delete the graphics stored in the printer's RAM or flash
memory.......................................................................................................................26
Z_Draw_Box()To draw a box..............................................................................27
Z_Draw_Line()To draw a line..............................................................................28
Z_Get_DLL_Version()To retrieve or display the version information of this
library...........................................................................................................................29
Z_Get_DLL_VersionA()To retrieve or display the version information of this
library...........................................................................................................................29
Z_Get_Graphic_ColorBMP()To convert BMP image file to grayscale mode
and store the graphics in the printer's RAM or flash memory............................31
Z_Get_Graphic_ColorBMPEx()To convert BMP image file to grayscale
mode and store the graphics in the printer's RAM or flash memory.................31
Z_Get_Graphic_ColorBMP_HBitmap()To convert BMP HBITMAP pointer
to grayscale format and store the graphics in the printer's RAM or flash
memory........................................................................................................................31
Z_Initial_Setting()Pre-processing.....................................................................35
Z_WriteData()To output data immediately or send it to temporary area......37
Z_ReadData()To retrieve data from the printer................................................39
Z_Load_Graphic()To print a graphical image..................................................41
Z_Open_ChineseFont()To enable Chinese bitmap font files (16*15 and
24*24)..........................................................................................................................43
Z_Print_Form()To print a Form, input its name and set the number of times
it is jumped and the number of copies printed......................................................44
Z_Print_Out()To print out all data......................................................................46
Z_Prn_Barcode()To print a barcode with the ability to jump numbers........47
Z_Prn_Text()To print a line of text with the ability to jump numbers.............52
Z_Prn_Text_Chinese()To print a line of text using a Chinese bitmap font
file (16*15 or 24*24)..................................................................................................54
Z_Prn_Text_TrueType()To print a line of text in TrueType font....................56
Z_Prn_Text_TrueType_W()To print a line of text in TrueType font and
control the width and height of the font..................................................................56
Z_Prn_Text_TrueType_Uni()To print a line of text in TrueType font............56
Z_Prn_Text_TrueType_UniB()To print a line of text in TrueType font.........56
Z_Clear_Memory()To clear the data in the printer's RAM memory..............61
Z_Clear_MemoryEx()To clear the data in the printer's RAM and flash
memory.......................................................................................................................62
Z_Set_Backfeed()To set label backfeed distance...........................................63
Z_Set_Darkness()To set the heat level of the thermal print head................64
Z_Set_DebugDialog()To set the debugging environment.............................65
Z_Set_Label()To set paper length; this is required for continuous form
paper............................................................................................................................66
Z_Set_Mode()To activate Cutter or Peel...........................................................67
Z_Set_Origin()To set the Y-coordinate of the starting print position............68
Z_Set_Paper()To set the paper as continuous or non-continuous label......69
Z_Set_Prncomport()To set the serial port.......................................................70
Z_Set_Prncomport_PC()To set the PC serial port.........................................72
Z_Set_Reset()To power on reset, and clear buffer and memory data.........74
Z_Set_Speed()To set the printer's printing speed...........................................75
Z_Set_TPH()To set the printer's transfer mode................................................76
Z_Set_Unit()To set the unit of measurement to inches, millimeters or pixels
......................................................................................................................................77
Z_Set_Gap()To set the length of the gap..........................................................78
Z_Set_ProcessDlg()To open or close the progress dialog box....................79
Z_Set_ErrorDlg()To open or close the retry inquiry dialog when transmitting
fail.................................................................................................................................80
Z_Bar2d_QRCode()To print QR Barcode.........................................................81
Z_Set_PrintWidth()To set the print area...........................................................83
Z_Print_OutQuality()To print out all data.........................................................84
Z_Set_Mirror()To enable or disable mirror mode............................................86
Z_Bar2d_RSS()To print an RSS barcode.........................................................87
Z_Set_EncryptionKey()Set the encryption key..............................................89
Z_Check_EncryptionKey()Check the encryption key correctness.............90
Z_GetUSBBufferLen()To search the device name of USB Printer and
return the length of USB Printer data.
Z_EnumUSB()To retrieve the device name of USB Printer.

Purpose: Z_EnumUSB()To retrieve the device name and data length of USB
Printer.

Syntax:
vc:
int Z_GetUSBBufferLen(void);
int Z_EnumUSB(char *buf);
VB: VBA:
Declare Function Z_GetUSBBufferLen() As Long
Declare Function Z_EnumUSB(ByVal buf As String) As Long
VB.net:
Declare Function Z_GetUSBBufferLen() As Integer
Declare Function Z_EnumUSB(ByVal buf As Byte()) As Integer

Parameters:
buf
[out] Stores USB Printer data.

Return values:
Z_GetUSBBufferLen(); returns the length of USB Printer data.
Z_EnumUSB(); 0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
char *pbuf;
int nLen = Z_GetUSBBufferLen() + 1;
if (nLen > 1) {
pbuf = (char *)new char[nLen];
Z_EnumUSB(pbuf);
}
VB: VBA:
Dim nLen As Long
Dim pbuf As String
nLen = Z_GetUSBBufferLen() + 1
If nLen > 1 Then
pbuf = Space(128)
Call Z_EnumUSB(pbuf)
End If
VB.net:
Dim nLen As Integer
Dim pbuf(128) As Byte
nLen = Z_GetUSBBufferLen() + 1
If nLen > 1 Then
Call Z_EnumUSB(pbuf)
End If

Description: These two functions are designed to be used together. First, use
Z_GetUSBBufferLen() to retrieve the data length of the USB port. Then,
allocate memory to Z_EnumUSB() to store the USB port data. The data from
USB port is split by ("0x0d0x0a"). For example, if the data is A-200(0x0d)
(0x0a)R-400ZIP, then USB1 is connected to A-200 and USB2 is connected to
R-400Zip.
Z_GetUSBDeviceInfo()To retrieve the device name and device path of
USB Printer.

Purpose: Z_GetUSBDeviceInfo()To retrieve the device name and device path


of USB Printer.

Syntax:
VC:
int Z_GetUSBDeviceInfo(int nPort, char *pDeviceName, int
*pDeviceNameLen, char *pDevicePath, int *pDevicePathLen);
VB: VBA:
Declare Function Z_GetUSBDeviceInfo(ByVal nPort As Long, ByVal
pDeviceName As String, ByRef pDeviceNameLen As Long, ByVal
pDevicePath As String, ByRef pDevicePathLen As Long) As Long
VB.net:
Declare Function Z_GetUSBDeviceInfo(ByVal nPort As Integer, ByVal
pDeviceName As Byte(), ByRef pDeviceNameLen As Integer, ByVal
pDevicePath As Byte(), ByRef pDevicePathLen As Integer) As Integer

Parameters:
nPort
[in] Specifies the USB printer from which data is to be retrieved; begins
with 1.
pDeviceName
[out] Name of USB printer device; if the input is a null pointer, no data will
be written.
pDeviceNameLen
[in] [out] When calling this function it is necessary to supply the length of
temporary storage of pDeviceName; when used as an output
parameter it returns the length of the device name.
pDevicePath
[out] Name of USB printer device; if the input is a null pointer, no data will
be written.
pDevicePathLen
[in] [out] When calling this function it is necessary to supply the length of
temporary storage of pDevicePath; when used as an output parameter
it returns the length of the device name.
Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
char buf1[128]={0}, buf2[128]={0};
int nLen1=128, nLen2=128, nlen;
nlen = Z_GetUSBBufferLen() + 1;
if (nlen > 1) {
Z_GetUSBDeviceInfo(1, buf1, &nLen1, buf2, &nLen2);
Z_CreatePrn(12, buf2); //or Z_CreatePort(6, 0, buf2);
}
VB: VBA:
Dim buf1 As String
Dim buf2 As String
Dim nLen1, nLen2, nlen As Long

nlen = Z_GetUSBBufferLen() + 1
If nlen > 1 Then
nLen1 = 128
nLen2 = 128
buf1 = Space(nLen1)
buf2 = Space(nLen2)
Call Z_GetUSBDeviceInfo(1, buf1, nLen1, buf2, nLen2)
Call Z_CreatePrn(12, buf2) 'or Call Z_CreatePort(6, 0, buf2)
End If
VB.net:
Dim buf1() As Byte
Dim buf2() As Byte
Dim nLen1, nLen2, nlen As Integer
Dim encAscII = System.Text.Encoding.ASCII

nlen = Z_GetUSBBufferLen() + 1
If nlen > 1 Then
nLen1 = 128
nLen2 = 128
ReDim buf1(nLen1)
ReDim buf2(nLen2)
Call Z_GetUSBDeviceInfo(1, buf1, nLen1, buf2, nLen2)
Call Z_CreatePrn(12, encAscII.GetString(buf2, 0, nLen2))
'or Call Z_CreatePort(6, 0, encAscII.GetString(buf2, 0, nLen2))
End If

Description: This function first calls Z_GetUSBBufferLen() to obtain the data


length of the USB printer.
Then Z_GetUSBDeviceInfo() is called to retrieve relevant information about
the USB printer.
The data stored in pDevicePath is the path of the USB device and can be
used in Z_CreatePrn() and Z_CreatePort() to create the USB device.
Z_GetNetPrinterBufferLen()To retrieve the device name of Net Printer and
return the length of Net Printer data.
Z_EnumNetPrinter()To retrieve the device name of Net Printer.

Purpose: Z_EnumUSB()To retrieve the device name and length of Net Printer.

Syntax:
VC:
int Z_GetNetPrinterBufferLen(void);
int Z_EnumNetPrinter(char *buf);
VB: VBA:
Declare Function Z_GetNetPrinterBufferLen() As Long
Declare Function Z_EnumNetPrinter(ByVal buf As String) As Long
VB.net:
Declare Function Z_GetNetPrinterBufferLen() As Integer
Declare Function Z_EnumNetPrinter(ByVal buf As Byte()) As Integer

Parameters:
buf
[out] Stores USB Printer data.

Return values:
Z_GetNetPrinterBufferLen(); returns the length of USB data.
Z_EnumNetPrinter(); 0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
char *pbuf;
int nLen = Z_GetNetPrinterBufferLen() + 1;
if (nLen > 1) {
pbuf = (char *)new char[nLen];
Z_EnumNetPrinter(pbuf);
}
VB: VBA:
Dim nLen As Long
Dim pbuf As String
nLen = Z_GetNetPrinterBufferLen() + 1
If nLen > 1 Then
pbuf = Space(128)
Call Z_EnumNetPrinter(pbuf)
End If
VB.net:
Dim nLen As Integer
Dim pbuf(128) As Byte
nLen = Z_GetNetPrinterBufferLen() + 1
If nLen > 1 Then
Call Z_EnumNetPrinter(pbuf)
End If

Description: These two functions are designed to be used together. First, call
Z_GetNetPrinterBufferLen() to retrieve the data length of Net Printer. Then,
allocate memory to Z_EnumNetPrinter() to store Net Printer data.
The data from Net Printer is split by ("0x0d0x0a"). For example, if the data is

NetPrinter:192.168.1.2(0x0d)(0x0a)NetPrinter:192.168.1.25, then NetPrinter1


is connected to NetPrinter:192.168.1.2 and NetPrinter2 is connected to
NetPrinter:192.168.1.25.
Z_CreatePrn()To create printer job

Purpose: To create printer job.

Syntax:
VC:
int Z_CreatePrn(int selection, LPCTSTR filename);
VB: VBA:
Declare Function Z_CreatePrn(ByVal selection As Long, ByVal filename As
String) As Long
VB.net:
Declare Function Z_CreatePrn(ByVal selection As Integer, ByVal filename
As String) As Integer

Parameters:
selection
[in] Selects output port or file.
0 -> print to file.
1 -> lpt1, 2 -> lpt2, 3 -> lpt3
4 -> com1, 5 -> com2, 6 -> com3
10 -> pipe, 11 -> USBXXX, 12 -> USB
13 -> LAN Client(TCP/IP)
filename
[in] If selection is 0, data is output to a file; filename contains the file name
and may include the file path.
If selection is 10, filename contains the output path or device code (device
path).
If selection is 11, filename refers to the index of the USB to be created,
starting with 1
If selection is 12, filename is the device code (device path) of the USB to
be created,
and works the same way as when nPort = 10
If selection is 13, filename is the IP Address to be opened using TCP/IP .
The default value of the port is 9100. If it is necessary to specify another
value, e.g. 80, append the string ":80" to the end of the IP Address.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_CreatePrn(1, NULL); or Z_CreatePrn(0, "C:\\out.prn");
Z_CreatePrn(10,"\\\\allen\\Label"); //share mode.
VB: VBA: VB.net:
Call Z_CreatePrn(1, null) or Call Z_CreatePrn(0, "C:\\out.prn")
Call Z_CreatePrn(10, "\\\\allen\\Label")

Description: The Z_CreatePrn() function creates the output port of your choice
or the output file you have keyed in. This function must be first executed
before all other functions.

Z_CreatePrn(), Z_CreateUSBPort(), Z_CreateNetPort() and Z_CreatePort()


can not be used at the same time.
Z_CreatePort()To create printer job

Purpose: To create printer job.

Syntax:
VC:
int Z_CreatePort(int nPortType, int nPort, LPCTSTR filename);
VB: VBA:
Declare Function Z_CreatePort(ByVal nPortType As Long, ByVal nPort As
Long, ByVal filename As String) As Long
VB.net:
Declare Function Z_CreatePort(ByVal nPortType As Integer, ByVal nPort As
Integer, ByVal filename As String) As Integer

Parameters:
nPortType
[in] Selects the type of the output port.
0 -> file
1 -> Serial port
2 -> Parallel prort
4 -> USB port
5 -> LAN port
6 -> USB port
nPort
[in] Selects the type of the output port.
If nPortType is 1, 1 -> com1, 2 -> com2,...
filename
[in] If selection is 0, data is output to a file; filename contains the file name
and may include the file path.
If selection is 4, filename refers to the index of the USB to be created,
starting with 1
If nPortType is 5, filename is the IP Address to be opened using TCP/IP
with port 9100.
If nPortType is 6, filename contains the path of the USB device to be
created.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_CreatePort(1, 1, NULL);
Z_CreatePort(0, 0, "C:\\out.prn");
Z_CreatePort(5, 0, "192.168.1.3");
VB: VBA: VB.net:
Call Z_CreatePort(1, 1, null)
Z_CreatePort(0, 0, "C:\\out.prn");
Z_CreatePort(5, 0, "192.168.1.3");

Description: The Z_CreatePort() function creates the output port of your


choice or the output file you have keyed in. This function must be called
before all other functions.
Z_CreatePrn(), Z_CreateUSBPort(), Z_CreateNetPort() and
Z_CreatePort() can not be used at the same time.
Z_CreateUSBPort()To create printer job
Z_CreateNetPort()To create printer job

Purpose: To create printer job.


Before using Z_CreateUSBPort(), it is necessary to call
Z_GetUSBBufferLen() first in order to be synchronized with
Z_EnumUSB() and Z_GetUSBDeviceInfo().
Before using Z_CreateNetPort(), it is necessary to call
Z_GetNetPrinterBufferLen() first in order to be synchronized with
Z_EnumNetPrinter() and Z_GetUSBDeviceInfo().

Syntax:
VC:
int Z_CreateUSBPort(int nPort);
int Z_CreateNetPort(int nPort);
VB: VBA:
Declare Function Z_CreateUSBPort(ByVal nPort As Long) As Long
Declare Function Z_CreateNetPort(ByVal nPort As Long) As Long
VB.net:
Declare Function Z_CreateUSBPort(ByVal nPort As Integer) As Integer
Declare Function Z_CreateNetPort(ByVal nPort As Integer) As Integer

Parameters:
nPort
[in] USB port; LAN port, nPort starts with 1.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
int nLen;
nLen = Z_GetUSBBufferLen();
if (nLen) {
Z_CreateUSBPort(1);
}
nLen = Z_GetNetPrinterBufferLen();
if (nLen) {
Z_CreateNetPort(1);
}
VB: VBA: VB.net:
Dim nLen As Long
nLen = Z_GetUSBBufferLen()
If nLen Then
Call Z_CreateUSBPort(1)
End If
nLen = Z_GetNetPrinterBufferLen()
If nLen Then
Call Z_CreateNetPort(1)
End If

Description: Z_CreateUSBPort() and Z_CreateNetPort() create the output port


you have selected or open the output file you have keyed in. This function
must be called before all other functions.
Z_CreatePrn(), Z_CreateUSBPort(), Z_CreateNetPort() and
Z_CreatePort() can not be used at the same time.
Z_ClosePrn()To close printer job

Purpose: To close printer job.

Syntax:
VC:
void Z_ClosePrn(void);
VB: VBA: VB.net:
Declare Sub Z_ClosePrn()

Example:
VC:
Z_ClosePrn();
VB: VBA: VB.net:
Call Z_ClosePrn()

Description: The Z_ClosePrn() function releases all resources and closes the
output port or the output file that you have opened. This function must be
called after all other functions.
Z_Bar2d_Maxi()To print a Maxi Code 2D barcode

Purpose: To print a Maxi Code 2D barcode.

Syntax:
VC:
int Z_Bar2d_Maxi(int x, int y, int nMode, int nSymbol, int nTotal, int nClass,
int nCountry, char cZipCode1[6], char cZipCode2[4], LPCTSTR data,
int increase);
VB: VBA:
Declare Function Z_Bar2d_Maxi(ByVal x As Long, ByVal y As Long, ByVal
nMode As Long, ByVal nSymbol As Long, ByVal nTotal As Long,
ByVal nClass As Long, ByVal nCountry As Long, ByVal cZipCode1 As
String, ByVal cZipCode2 As String, ByVal data As String, ByVal
increase As Long) As Long
VB.net:
Declare Function Z_Bar2d_Maxi(ByVal x As Integer, ByVal y As Integer,
ByVal nMode As Integer, ByVal nSymbol As Integer, ByVal nTotal As
Integer, ByVal nClass As Integer, ByVal nCountry As Integer, ByVal
cZipCode1 As String, ByVal cZipCode2 As String, ByVal data As
String, ByVal increase As Integer) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
nMode
[in]Barcode mode
2: Numeric Postal Code(US)
3: Alphanumeric Postal Code(Non-US)
nSymbol
[in]Symbol Number: 1 ~ 8
nTotal
[in] Symbol Number ranges from 1 to 8
nClass
[in]three digit class of service
nCountry
[in]three digit country code
cZipCode1
[in]nMode = 2 --> five digit zip code
nMode = 3 --> six character zip code
cZipCode2
[in]four digit zip code extension. Only used in nMode = 2.
data
[in] Data string, 84 characters maximum.
increase
[in] Increment, default value = 0

Return value: 0 -> OK.


Reference ZW-Error.txt file.

Example:
VC:
Z_Bar2d_Maxi(50, 50, 2, 1, 1, 001, 840, "15238", "2802", "This MaxiCode",
0);
VB: VBA: VB.net:
Call Z_Bar2d_Maxi(50, 50, 2, 1, 1, 001, 840, "15238", "2802", "This
MaxiCode", 0)

Description: The Z_Bar2d_Maxi() function prints out a Maxi Code 2D barcode.


Z_Bar2d_PDF417()To print a PDF417 2D barcode

Purpose: To print a PDF417 2D barcode.

Syntax:
VC:
int Z_Bar2d_PDF417(int x, int y, int o, int h, int s, int c, int r, int t, int narrow,
LPCTSTR data, int increase);
VB: VBA:
Declare Function Z_Bar2d_PDF417(ByVal x As Long, ByVal y As Long,
ByVal o As Long, ByVal h As Long, ByVal s As Long, ByVal c As
Long, ByVal r As Long, ByVal t As Long, ByVal narrow As Long, ByVal
data As String, ByVal increase As Long) As Long
VB: VBA:
Declare Function Z_Bar2d_PDF417(ByVal x As Integer, ByVal y As Integer,
ByVal o As Integer, ByVal h As Integer, ByVal s As Integer, ByVal c As
Integer, ByVal r As Integer, ByVal t As Integer, ByVal narrow As
Integer, ByVal data As String, ByVal increase As Integer) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
o
[in] Print rotation: '1' is 0°, '2' is 90°, '3' is 180° and '4' is 270°
h
[in]Barcode height for Individual Rows
h * module = height of individual rows
s
[in] Error correction level: 0 - 8
c
[in]column count
r
[in]row count
t
[in] Truncation flag, '0 'is normal and '1' is truncated.
narrow;
[in] Height of module.
data
[in] Data string, 84 characters maximum.
increase
[in] Increment, default value = 0

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Bar2d_PDF417(50, 50, 0, 5, 5, 2, 83, 0, 2, "PDF-417", 0);
VB: VBA: VB.net:
Call Z_Bar2d_PDF417(50, 50, 0, 5, 5, 2, 83, 0, 2, "PDF-417", 0)

Description: The Z_Bar2d_PDF417() function prints out a PDF417 2D


barcode.
Z_Set_FlashMemory()To set the storage location of Form

Purpose: To set the storage location of Form.

Syntax:
VC:
int Z_Set_FlashMemory(int Status);
VB: VBA:
Declare Function Z_Set_FlashMemory(ByVal Status As Long) As Long
VB.net:
Declare Function Z_Set_FlashMemory(ByVal Status As Integer) As Integer

Parameters:
Status
[in] Storage location.
0 -> RAM, 1 -> Flash Memory
Note: Flash memory has a limited lifetime. It is recommended that data be
stored in RAM unless it will be reused.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_FlashMemory(0);
VB: VBA: VB.net:
Call Z_Set_FlashMemory(0)

Description: The Z_Set_FlashMemory() function sets the storage location of


Form. Before using Form, it is necessary to execute Z_Set_FlashMemory()
first.
Z_Set_Format_New()To set the name of Form

Purpose: To set the name of Form.

Syntax:
VC:
void Z_Set_Format_New(LPCTSTR FormName);
VB: VBA: VB.net:
Declare Sub Z_Set_Format_New(ByVal FormatName As String)

Parameters:
FormName
[in] Name of Form.

Example:
VC:
Z_Set_Format_New("demo");
VB: VBA: VB.net:
Call Z_Set_Format_New("demo")

Description: The Z_Set_Format_New() function sets the name of Form. After


the name is set, Form can be called directly and then printed.
Z_Del_Format()To delete Form

Purpose: To delete Form.

Syntax:
VC:
int Z_Del_Format(int memory, char FormName[11]);
VB: VBA:
Declare Function Z_Del_Format(ByVal nMem As Long, ByVal formname As
String) As Long
VB.net:
Declare Function Z_Del_Format(ByVal nMem As Integer, ByVal formname
As String) As Integer

Parameters:
memory
[in] Storage location.
0 -> RAM , 1 -> Flash Memory.
FormName
[in] Name of Form. 10 characters maximum.

Example:
VC:
Z_Del_Format(0, "demo");
VB: VBA: VB.net:
Call Z_Del_Format(0, "demo")

Description: The Z_Del_Format() function can be used to delete the Form


stored in the printer.
Z_Del_Graphic()To delete the graphics stored in the printer's RAM or flash
memory

Purpose: Z_Del_Graphic()To delete the graphics stored in the printer's RAM


or flash memory

Syntax:
VC:
int Z_Del_Graphic(int memory, char GraphicName[11]);
VB: VBA:
Declare Function Z_Del_Graphic(ByVal memory As Long, ByVal
graphicname As String) As Long
VB.net:
Declare Function Z_Del_Graphic(ByVal memory As Integer, ByVal
graphicname As String) As Integer

Parameters:
memory
[in] Storage location.
0 -> RAM, 1 -> Flash Memory
graphicname
[in] Name of graphic. 10 characters maximum.

Example:
VC:
Z_Del_Graphic(0, "girl");
VB: VBA: VB.net:
Call Z_Del_Graphic(0, "girl")

Description: The Z_Del_Graphic() function can to deletes the graphics stored


inside in the printer.
Z_Draw_Box()To draw a box

Purpose: To draw a box.

Syntax:
VC:
int Z_Draw_Box(int x, int y, int width, int height, int thickness);
VB: VBA:
Declare Function Z_Draw_Box(ByVal x As Long, ByVal y As Long, ByVal
width As Long, ByVal height As Long, ByVal thickness As Long) As
Long
VB.net:
Declare Function Z_Draw_Box(ByVal x As Integer, ByVal y As Integer,
ByVal width As Integer, ByVal height As Integer, ByVal thickness As
Integer) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
width
[in] Length Width of box, 0 < width < 9999.
height
[in] Length Height of box, 0 < height < 9999.
thickness
[in] Thickness of line, > 0.

Example:
VC:
Z_Draw_Box(50, 100, 250, 100, 5);
VB: VBA: VB.net:
Call Z_Draw_Box(50, 100, 250, 100, 5)

Description: The Z_Draw_Box() function draws boxes.


Z_Draw_Line()To draw a line

Purpose: To draw a line.

Syntax:
VC:
int Z_Draw_Line(int x, int y, int width, int height);
VB: VBA:
Declare Function Z_Draw_Line(ByVal x As Long, ByVal y As Long, ByVal
width As Long, ByVal height As Long) As Long
VB.net:
Declare Function Z_Draw_Line(ByVal x As Integer, ByVal y As Integer,
ByVal width As Integer, ByVal height As Integer) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
width
[in] Length Width of line, 0 < width < 9999.
height
[in] Length Height of line, 0 < height < 9999.

Example:
VC:
Z_Draw_Box(50, 100, 250, 3);
VB: VBA: VB.net:
Call Z_Draw_Box(50, 100, 250, 3)

Description: The Z_Draw_Line() function draws a line.


Z_Get_DLL_Version()To retrieve or display the version information of this
library
Z_Get_DLL_VersionA()To retrieve or display the version information of this
library

Purpose: To retrieve or display the version information of this library.

Syntax:
VC:
char* Z_Get_DLL_Version(int nShowMessage);
int Z_Get_DLL_VersionA(int nShowMessage);
VB: VBA:
Declare Function Z_Get_DLL_Version(ByVal nShowMessage As Long) As
Long
Declare Function Z_Get_DLL_VersionA(ByVal nShowMessage As Long) As
Long
VB.net:
Declare Function Z_Get_DLL_Version(ByVal nShowMessage As Integer)
As String
Declare Function Z_Get_DLL_VersionA(ByVal nShowMessage As Integer)
As Integer

Parameters:
nShowMessage
[in] Whether to display message window.
0 -> No, 1 -> Yes.

Return values:
Z_Get_DLL_Version(); returns version information string or NULL if
unsuccessful.
Z_Get_DLL_VersionA(); return version value.
MainVersion = (return version value) / 100.
SubVersion = (return version value) % 100.
Example:
VC:
int nVersion, nMainVersion, nSubVersion;
nVersion = A_Get_DLL_VersionA(1);
nMainVersion = nVersion / 100;
nSubVersion = nVersion % 100;
VB: VBA:
Dim nVersion, nMainVersion, nSubVersion As Long
nVersion = A_Get_DLL_VersionA(1)
nMainVersion = Int(nVersion / 100)
nSubVersion = nVersion Mod 100
VB.net:
Dim nVersion, nMainVersion, nSubVersion As Integer
nVersion = A_Get_DLL_VersionA(1)
nMainVersion = nVersion / 100
nSubVersion = nVersion Mod 100

Description: The Z_Get_DLL_Version() function allows the user to obtain or


show the version information of this library.
Because the Z_Get_DLL_Version() is return the string.
If using VB and VBA to develop, need to use RtlMoveMemory() to convert,
there is technical difficulty to using RtlMoveMemory().
If you use VB and VBA to develop propose not using this function,
please change to use Z_Get_DLL_VersionA().
If you must use Z_Get_DLL_Version(), please reference MSDN.
Z_Get_Graphic_ColorBMP()To convert BMP image file to grayscale mode
and store the graphics in the printer's RAM or flash memory.
Z_Get_Graphic_ColorBMPEx()To convert BMP image file to grayscale
mode and store the graphics in the printer's RAM or flash memory.
Z_Get_Graphic_ColorBMP_HBitmap()To convert BMP HBITMAP pointer
to grayscale format and store the graphics in the printer's RAM or flash
memory.

Purpose: To convert BMP image file to grayscale mode and store the graphics
in the printer's RAM or flash memory.

Syntax:
VC:
int Z_Get_Graphic_ColorBMP(int x, int y, int memory, LPCTSTR filename);
int Z_Get_Graphic_ColorBMPEx(int x, int y, int nWidth, int nHeight, int
rotate, int mem_mode, LPCTSTR id_name, LPCTSTR filename);
int Z_Get_Graphic_ColorBMP_HBitmap(int x, int y, int nWidth, int nHeight,
int rotate, int mem_mode, LPCTSTR id_name, HBITMAP hbm);
VB: VBA:
Declare Function Z_Get_Graphic_ColorBMP(ByVal x As Long, ByVal y As
Long, ByVal memory As Long, ByVal filename As String) As Long
Declare Function Z_Get_Graphic_ColorBMPEx(ByVal x As Long, ByVal y
As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal rotate
As Long, ByVal mem_mode As Long, ByVal id_name As String, ByVal
filename As String) As Long
Declare Function Z_Get_Graphic_ColorBMP_HBitmap(ByVal x As Long,
ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long,
ByVal rotate As Long, ByVal mem_mode As Long, ByVal id_name As
String, ByVal hbm As Long) As Long
VB.net:
Declare Function Z_Get_Graphic_ColorBMP(ByVal x As Integer, ByVal y As
Integer, ByVal memory As Integer, ByVal filename As String) As
Integer
Declare Function Z_Get_Graphic_ColorBMPEx(ByVal x As Integer, ByVal y
As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal
rotate As Integer, ByVal mem_mode As Integer, ByVal id_name As
String, ByVal filename As String) As Integer
Declare Function Z_Get_Graphic_ColorBMP_HBitmap(ByVal x As Integer,
ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As
Integer, ByVal rotate As Integer, ByVal mem_mode As Integer, ByVal
id_name As String, ByVal hbm As Integer) As Integer

Parameters:
x
[in] X-coordinate.
y
[in] Y-coordinate.
nWidth
[In] This parameter specifies the width of the scaled graphics; 0 indicates
original width.
nHeight
[In] This parameter specifies the height width of the scaled graphics; 0
indicates original height.
rotate
[In] This parameter specifies the degree of rotation of the scaled graphics;
'0' is 0°, '1' is 90°, '2' is 180° and '3' is 270°.
memory
[in] Storage location 0 -> RAM 1 -> Flash Memory.
Note: Flash memory has a limited lifetime. It is recommended that data be
stored in RAM unless it will be reused.
id_name
[In] Provides a name to be stored in the printer for identification purposes;
can be call out graphic retrieved directly via the Z_Load_Graphic()
function.
filename
[In] Name of graphics file; may contain file path.
The format is as follows: XXXXXXXX.XXX or X:\\XXX\\XXX.XXX
hbm
[In] GDI HBITMAP Handle, which supports only the IMAGE_BITMAP
format.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Get_Graphic_ColorBMP(30, 20, 0, "bb.bmp");
Z_Get_Graphic_ColorBMPEx(30, 20, 200, 150, 2, 1, "bb1", "bb.bmp");//180
angle.
HANDLE himage = LoadImage(NULL, "bb.bmp", IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE);
Z_Get_Graphic_ColorBMP_HBitmap(30, 20, 250, 80, 1, 1, "bb2",
(HBITMAP)himage);//90 angle.
VB: VBA:
Const IMAGE_BITMAP = 0
Const LR_LOADFROMFILE = &H10
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA"
(ByVal hInst As Long, ByVal lpsz As String, ByVal un1 As Long, ByVal n1
As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Private Declare Function DeleteObject Lib "Gdi32" (ByVal ho As Long) As
Long

Call Z_Get_Graphic_ColorBMP(30, 20, 0, "bb.bmp")


Call Z_Get_Graphic_ColorBMPEx(30, 20, 200, 150, 2, 1, "bb1", "bb.bmp") '
180 angle.
Dim himage As Long
himage = LoadImage(0, "bb.bmp", IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE)
Call Z_Get_Graphic_ColorBMP_HBitmap(30, 20, 250, 80, 1, 1, "bb2",
himage) ' 90 angle.
If himage Then
Call DeleteObject(himage)
End If
VB.net:
Const IMAGE_BITMAP = 0
Const LR_LOADFROMFILE = &H10
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA"
(ByVal hInst As Integer, ByVal lpsz As String, ByVal un1 As Integer, ByVal
n1 As Integer, ByVal n2 As Integer, ByVal un2 As Integer) As Integer

Call Z_Get_Graphic_ColorBMP(30, 20, 0, "bb.bmp")


Call Z_Get_Graphic_ColorBMPEx(30, 20, 200, 150, 2, 1, "bb1", "bb.bmp") '
180 angle.
Dim himage As Integer
himage = LoadImage(0, "bb.bmp", IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE)
Call Z_Get_Graphic_ColorBMP_HBitmap(30, 20, 250, 80, 1, 1, "bb2",
himage) ' 90 angle.

Description: You may provide a color BMP image file of any bit map length to
the Z_Get_Graphic_ColorBMP() function; it will automatically be converted to
a B&W grayscale image and sent to the printer for output.
The Z_Get_Graphic_ColorBMPEx() and
Z_Get_Graphic_ColorBMP_HBitmap() functions can be used to carry out
zoom in, zoom out and rotation functions. They take file names and GDI
HBITMAP Handles as data sources.
Z_Initial_Setting()To carry out initialization tasksPre-processing.

Purpose: To carry out initialization tasksPre-processing.

Syntax:
VC:
int Z_Initial_Setting(int mode, LPCTSTR Source);
VB: VBA:
Declare Function Z_Initial_Setting(ByVal mode As Long, ByVal Source As
String) As Long
VB.net:
Declare Function Z_Initial_Setting(ByVal mode As Integer, ByVal Source As
String) As Integer

Parameters:
mode
[In] Select input mode; if value is 0 -> input string; if value is 1 -> input file.
Source
[In] Data source, string or file name (may contain file path).

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
LPCTST aa = "^FO120,30\r\n";
Z_Initial_Setting(0, aa);
or
Z_Initial_Setting(1, "initfile.txt");
VB: VBA: VB.net:
Dim aa As String
aa = "^FO120,30" + Chr(13) + Chr(10)
Call Z_Initial_Setting(0, aa)
or
Call Z_Initial_Setting(1, "initfile.txt")

Description: The initialization tasks carried outpre-processing by the


Z_Initial_Setting() function include sending text or file commands to the
printer. This function must come after Z_Create_Prn() and before all other
functions; it can also be of user-defined type.
Z_WriteData()To output data immediately or send it to temporary storage
area.

Purpose: To output data immediately or send it to temporary storage area.

Syntax:
VC:
int Z_WriteData(int IsImmediate, LPCTSTR pbuf, DWORD length);
VB: VBA:
Declare Function Z_WriteData(ByVal IsImmediate As Long, ByVal pbuf As
String, ByVal length As Long) As Long
VB.net:
Declare Function Z_WriteData(ByVal IsImmediate As Integer, ByVal pbuf As
Byte(), ByVal length As ULong) As Integer

Parameters:
IsImmediate
[In] 1 signifies that the data should be sent immediately, and only the data
in pbuf should be sent to the output port;
0 indicates that the data is to be stored to the temporary area and will only
be sent when Z_Print_Out() is called.
pbuf
[In] The data Ppointerer to the data to be sent.
length
[In] Length of pbuf data.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
const char sznop1[] = "nop_front\r\n";
const char sznop2[] = "nop_middle\r\n";
Z_WriteData(0, sznop2, (DWORD)strlen(sznop2));
Z_WriteData(1, sznop1, (DWORD)strlen(sznop1));
VB: VBA:
Dim sznop1 As String = "nop_front" + vbCrLf
Dim sznop2 As String = "nop_middle" + vbCrLf
Call Z_WriteData(0, sznop2, Len(sznop2))
Call Z_WriteData(1, sznop1, Len(sznop1))
VB.net:
Dim encAscII = System.Text.Encoding.ASCII
Dim sznop1 As String = "nop_front" + vbCrLf
Dim sznop2 As String = "nop_middle" + vbCrLf
Call Z_WriteData(0, encAscII.GetBytes(sznop2), sznop2.Length)
Call Z_WriteData(1, encAscII.GetBytes(sznop1), sznop1.Length)

Description: Any controls, commands or data that you wish to send to the
printer can be sent via this function.
Z_ReadData()To retrieve data stored inside from the printer.

Purpose: To retrieve data stored insidefrom the printer.

Syntax:
VC:
int Z_ReadData(LPTSTR pbuf, DWORD length, DWORD dwTimeoutms);
VB: VBA:
Declare Function Z_ReadData(ByVal pbuf As String, ByVal length As Long,
ByVal dwTimeoutms As Long) As Long
VB.net:
Declare Function Z_ReadData(ByVal pbuf As Byte(), ByVal length As
ULong, ByVal dwTimeoutms As ULong) As Integer

Parameters:
pbuf
[out] Contains the pointer to the returned data. If it is a null pointer, no data
is written.
length
[in] Size of data to be read.
dwTimeoutms
[in] Time counter, i.e. maximum length of time allowed when reading data
(unit: ms).

Return values:
Size of data to be read.

Example:
VC:
int ret;
char temp[100]={0};
Z_WriteData(1, "~HS\r\n", 5);//~HS
ret = Z_ReadData(temp, 82, 1000);//1 second.
VB: VBA:
Dim ret As Integer
Dim temp As String
temp = Space(100)
temp = "~HS\r\n"
Z_WriteData(1, temp, 5) '~HS
ret = Z_ReadData(pbuf, 82, 1000) '1 second.
VB.net:
Dim ret As Integer
Dim temp(100) As Byte
Z_WriteData(1, encAscII.GetBytes("~HS\r\n"), 5) '~HS
ret = Z_ReadData(pbuf, 82, 1000) '1 second.

Description: This function is used to read the data returned from the printer, so
please check to see if the communication port being used has the ability to
return data. Use this function in conjunction with the Z_WriteData() function
and refer to the “Argox programmer's manual” for additional information.
Z_Load_Graphic()To print a graphical image

Purpose: To print a graphical image.

Syntax:
VC:
int Z_Load_Graphic(int x, int y, int memory, char graphicname[11], int hori,
int vert);
VB: VBA:
Declare Function Z_Load_Graphic(ByVal x As Long, ByVal y As Long,
ByVal memory As Long, ByVal graphicname As String, ByVal hori As
Long, ByVal vert As Long) As Long
VB.net:
Declare Function Z_Load_Graphic(ByVal x As Integer, ByVal y As Integer,
ByVal memory As Integer, ByVal graphicname As String, ByVal hori
As Integer, ByVal vert As Integer) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
memory
[in] Storage location. 0 -> RAM 1 -> Flash Memory.
Note: Flash memory has a limited lifetime. It is recommended that data be
stored in RAM unless it will be reused.
graphicname
[in] Name of image file; 10 characters maximum.
hori
[in] Vertical magnification factor. 1 <= hori <= 10, default is 1.
vert
[in] Horizontal magnification factor. 1 <= hori <= 10, default is 1.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Load_Graphic(50, 30, 0, "phone", 1, 1);
VB: VBA: VB.net:
Call Z_Load_Graphic(50, 30, 0, "phone", 1, 1)

Description: The Z_Load_Graphic() function prints a graphic image. The


Z_Get_Graphic() function must first be called to obtain the image, which is
then loaded into the printer's RAM or flash memory.
Z_Open_ChineseFont()To enable Chinese bitmap font files (16*15 and
24*24)

Purpose: To enable Chinese bitmap font files (16*15 and 24*24)

Syntax:
VC:
int Z_Open_ChineseFont(char* path);
VB: VBA:
Declare Function Z_Open_ChineseFont(ByVal path As String) As Long
VB.net:
Declare Function Z_Open_ChineseFont(ByVal path As String) As Integer

Parameters:
path
[in] Source path for Chinese bitmap font files.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Open_ChineseFont("C:\\ET3");
VB: VBA: VB.net:
Call Z_Open_ChineseFont("C:\\ET3")

Description: The Z_Open_ChineseFont() function opens Chinese bitmap font


files (16*15 and 24*24), to be used by the function Z_Prn_Text_Chinese().
Z_Print_Form()To print a Form, input its name and set the number of times
it is jumped and the number of copies printed

Purpose: To print a Form, input its name and set the number of times it is
jumped and the number of copies printed

Syntax:
VC:
int Z_Print_Form(int labset, int copies, int mem, char formout[11]);
VB: VBA:
Declare Function Z_Print_Form(ByVal labset As Long, ByVal copies As
Long, ByVal mem As Long, ByVal formout As String) As Long
VB.net:
Declare Function Z_Print_Form(ByVal labset As Integer, ByVal copies As
Integer, ByVal mem As Integer, ByVal formout As String) As Integer

Parameters:
labset
[in] No. of label sets to be printed; values allowed: 1 to 32767.
copies
[in] No. of label sets to be copied; values allowed: 1 to 32767.
mem
[in] Storage location.
0 -> RAM 1 -> Flash Memory.
formout
[in] Name of the Form, which is the same as the one loaded previously or
the one stored within the printer.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Print_Form(3, 2, 0, "demo");
VB: VBA: VB.net:
Call Z_Print_Form(3, 2, 0, "demo");
Description: The Z_Print_Form() function will send all data and forms to the
printer. This function can only be used after Z_Set_Format_New() and all
other functions have been executed, and also before Z_ClosePrn() is called.
When this function is used, it is not necessary to call Z_Print_Out().
Z_Print_Out()To print out all data

Purpose: To print out all data.

Syntax:
VC:
int Z_Print_Out(int set,int copies);
VB: VBA:
Declare Function Z_Print_Out(ByVal sets As Long, ByVal copies As Long)
As Long
VB.net:
Declare Function Z_Print_Out(ByVal sets As Integer, ByVal copies As
Integer) As Integer

Parameters:
sets
[in] Pause and cut value.
copies
[in] No. of copies to be printed.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Print_Out(1, 1);
VB: VBA: VB.net:
Call Z_Print_Out(1, 1)

Description: The Z_Print_Out() function sends all data to the printer. This
function should be called after all other functions and before Z_ClosePrn().
It is best to switch to the Z_Print_OutQuality() function instead.
Z_Prn_Barcode()To print a barcode with the ability to jump numbers

Purpose: To print a barcode with the ability to jump numbers.

Syntax:
VC:
Z_Prn_Barcode(int x, int y, int ori, int narrow, int width, int height, char
bar_type, int increase, LPCTSTR data, char p1, char p2, char p3,
char p4, char p5);
VB: VBA:
Declare Function Z_Prn_Barcode(ByVal x As Long, ByVal y As Long, ByVal
ori As Long, ByVal narrow As Long, ByVal width As Long, ByVal
height As Long, ByVal bar_type As Byte, ByVal increase As Long,
ByVal data As String, ByVal p1 As Byte, ByVal p2 As Byte, ByVal p3
As Byte, ByVal p4 As Byte, ByVal p5 As Byte) As Long
VB.net:
Declare Function Z_Prn_Barcode(ByVal x As Integer, ByVal y As Integer,
ByVal ori As Integer, ByVal narrow As Integer, ByVal width As Integer,
ByVal height As Integer, ByVal bar_type As Byte, ByVal increase As
Integer, ByVal data As String, ByVal p1 As Byte, ByVal p2 As Byte,
ByVal p3 As Byte, ByVal p4 As Byte, ByVal p5 As Byte) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
ori
[in] Print rotation: '1' is 0°, '2' is 90°, '3' is 180° and '4' is 270°
narrow
[in] Narrow bar width.
width
[in] Wide bar width.
height
[in] Barcode height.
bar_type
[in] Barcode type (refer to the table below -> Type).
increase
[in] Increment.
data
[In] Data string.
p1,p2,p3,p4,p5
[in] These have different meanings depending on Type.

Remark: If p1, p2, p3, p4, and p5 are not specified, Y: print and N: do not
print; if not used, any arbitrary input value is acceptable.
Type Barcode type Parameters
1 Code 11 p1: Check code
Y: 1-digit
N: 2-digit
p2: Whether or not to print barcode
data
p3: Whether or not to print barcode
data above the barcode
2 Interleaved 2 of 5 p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode
p3: Whether or not to print the check
code
3 Code 39 p1: Whether or not to print the check
code
p2: Whether or not to print barcode
data
p3: Whether or not to print barcode
data above the barcode
8 EAN-8 p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode
9 UPC-E p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode
p3: Whether or not to print the check
code
A Code93 p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode
p3: Whether or not to print the check
code
C Code 128 Subset p1: Whether or not to print barcode
A,B,C data
Code 128 UCC p2: Whether or not to print barcode
data above the barcode
p3: Whether or not to print the check
code
p4: Code 128 subset A, B, C or Code
128 UCC
N:Code 128
U:Code 128 UCC
E EAN-13 p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode
I Industrial 2 of 5 p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode
J Standard 2 of 5 p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode
K ANSI Codabar p1: Whether or not to print the check
code
p2: Whether or not to print barcode
data
p3: Whether or not to print barcode
data above the barcode
p4: Start character
p5: End character
L LOGMARS Code p1: Whether or not to print barcode
data above the barcode
M MSI Code p1: Check code
A: No check code
B:1 Mod 10
C:2 Mod 10
D:1 Mod 10 and 1 Mod 11
p2: Whether or not to print barcode
data
p3: Whether or not to print barcode
data above the barcode
p4: Whether or not to print check code
with the barcode
P Plessey p1: Whether or not to print the check
code
p2: Whether or not to print barcode
data
p3: Whether or not to print barcode
data above the barcode
S UPC/EAN Extensions p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode
U UPC-A Code p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode
p3: Whether or not to print the check
code
Z POSTENET Code p1: Whether or not to print barcode
data
p2: Whether or not to print barcode
data above the barcode

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Prn_Barcode(650, 15, 1, 2, 2, 51, 'C', 0, "1234567", 'Y', 'N', 'N', 'N', 'N');
VB: VBA: VB.net:
Call Z_Prn_Barcode(650, 15, 1, 2, 2, 51, Asc("C"), 0, "1234567", Asc("Y"),
Asc("N"), Asc("N"), Asc("N"), Asc("N"))

Description: The Z_Prn_Barcode() function prints out a barcode.


Z_Prn_Text()To print a line of text with the ability to jump numbers

Purpose: To print a barcode with the ability to jump numbers.

Syntax:
VC:
int Z_Prn_Text(int x, int y, int ori, char font, int height, int width,int increase,
LPCTSTR data);
VB:
Declare Function Z_Prn_Text(ByVal x As Integer, ByVal y As Integer, ByVal
ori As Integer, ByVal font As Byte, ByVal height As Integer, ByVal
width As Integer, ByVal numeric As Integer, ByVal data As String) As
Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
ori
[in] Print rotation: '1' is 0°, '2' is 90°, '3' is 180° and '4' is 270°
font
[In] Selects font.

A - H: bitmap fonts,

0, P - V: scalable fonts.
Bitmap font sizes:

Font H*W
A 9* 5
B 11 * 7
C,D 18 * 10
E 28 * 15
F 26 * 13
G 60 * 40
H 21 * 13
height
[In] Horizontal magnification.
width
[In] Vertical magnification.
For font A - H, enter multiples of Font Size (maximum is 10).
For font 0, P - V, this is expressed in points; valid values: 1 to 1500, but
the maximum value of each font will be different.
increase
[in] Increment.
data
[In] Data string.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Prn_Text(50, 110, 1, 'A', 90, 10, 0, "A123456");
VB: VBA: VB.net:
Call Z_Prn_Text(50, 110, 1, Asc("A"), 90, 10, 0, "A123456")

Description: The Z_Prn_Text() function prints a line of text with the ability to
jump numbers.
Z_Prn_Text_Chinese()To print a line of text using a Chinese bitmap font
file (16*15 or 24*24)

Purpose: Z_Prn_Text_Chinese()To print a line of text using a Chinese bitmap


font file (16*15 or 24*24)

Syntax:
VC:
int Z_Prn_Text_Chinese(int x, int y, int fonttype, LPCTSTR id_name,
LPCTSTR data, int mem);
VB: VBA:
Declare Function Z_Prn_Text_Chinese(ByVal x As Long, ByVal y As Long,
ByVal fonttype As Long, ByVal id_name As String, ByVal data As
String, ByVal mem As Long) As Long
VB.net:
Declare Function Z_Prn_Text_Chinese(ByVal x As Integer, ByVal y As
Integer, ByVal fonttype As Integer, ByVal id_name As String, ByVal
data As String, ByVal mem As Integer) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
fonttype
[In] Choice of bitmap font.
0 -> 16*15, ¡B1 -> 24*24.¡C
id_name
[In] Provides a name for identification and stores it in the printer. Call
Z_Load_Graphic() subsequently to
load the corresponding stored image.
data
[In] Text content.
mem
[In] Storage location of graphics.
0 -> RAM, 1 -> Flash Memory.
Note: Flash memory has a limited lifetime. It is recommended that data be
stored in RAM unless it will be reused.
Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Open_ChineseFont("C:\\ET3");
Z_Prn_Text_Chinese(100, 100, 0, "A01", "°ê®a§Q¯q·í«e¢Ï¢ê¢Ñ¢ë¢Ò¢ì",
0);
VB: VBA: VB.net:
Call Z_Open_ChineseFont("C:\\ET3")
Call Z_Prn_Text_Chinese(100, 100, 0, "A01", "國家利益當前AbCcDd",
0)

Description: The Z_Prn_Text_Chinese() function prints a line of text using a


Chinese bitmap font file (16*15 or 24*24).
Z_Prn_Text_TrueType()To print a line of text in TrueType font
Z_Prn_Text_TrueType_W()To print a line of text in TrueType font and
control the width and height of the font.
Z_Prn_Text_TrueType_Uni()To print a line of text in TrueType font
Z_Prn_Text_TrueType_UniB()To print a line of text in TrueType font

Purpose: To print a line of text in TrueType font.

Syntax:
VC:
int Z_Prn_Text_TrueType(int x, int y, int FSize, LPCTSTR FType, int Fspin,
int FWeight, int FItalic, int FUnline, int FStrikeOut, LPCTSTR
id_name, LPCTSTR data, int mem_mode);
int Z_Prn_Text_TrueType_W(int x, int y, int FHeight, int FWidth, LPCTSTR
FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut,
LPCTSTR id_name, LPCTSTR data, int mem_mode);
int Z_Prn_Text_TrueType_Uni(int x, int y, int FSize, LPCTSTR FType, int
Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, LPCTSTR
id_name, LPCWSTR data, int format, int mem_mode);
int Z_Prn_Text_TrueType_UniB(int x, int y, int FSize, LPCTSTR FType, int
Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, LPCTSTR
id_name, LPCTSTR data, int format, int mem_mode);
VB: VBA:
Declare Function Z_Prn_Text_TrueType(ByVal x As Long, ByVal y As Long,
ByVal FSize As Long, ByVal FType As String, ByVal Fspin As Long,
ByVal FWeight As Long, ByVal FItalic As Long, ByVal FUnline As
Long, ByVal FStrikeOut As Long, ByVal id_name As String, ByVal
data As String, ByVal mem As Long) As Long
Declare Function Z_Prn_Text_TrueType_W(ByVal x As Long, ByVal y As
Long, ByVal FHeight As Long, ByVal FWidth As Long, ByVal FType
As String, ByVal Fspin As Long, ByVal FWeight As Long, ByVal FItalic
As Long, ByVal FUnline As Long, ByVal FStrikeOut As Long, ByVal
id_name As String, ByVal data As String, ByVal mem As Long) As
Long
Declare Function Z_Prn_Text_TrueType_Uni(ByVal x As Long, ByVal y As
Long, ByVal FSize As Long, ByVal FType As String, ByVal Fspin As
Long, ByVal FWeight As Long, ByVal FItalic As Long, ByVal FUnline
As Long, ByVal FStrikeOut As Long, ByVal id_name As String, ByRef
data As Byte, ByVal format As Long, ByVal mem_mode As Long) As
Long
Declare Function Z_Prn_Text_TrueType_UniB(ByVal x As Long, ByVal y As
Long, ByVal FSize As Long, ByVal FType As String, ByVal Fspin As
Long, ByVal FWeight As Long, ByVal FItalic As Long, ByVal FUnline
As Long, ByVal FStrikeOut As Long, ByVal id_name As String, ByRef
data As Byte, ByVal format As Long, ByVal mem_mode As Long) As
Long
VB.net:
Declare Function Z_Prn_Text_TrueType(ByVal x As Integer, ByVal y As
Integer, ByVal FSize As Integer, ByVal FType As String, ByVal Fspin
As Integer, ByVal FWeight As Integer, ByVal FItalic As Integer, ByVal
FUnline As Integer, ByVal FStrikeOut As Integer, ByVal id_name As
String, ByVal data As String, ByVal mem As Integer) As Integer
Declare Function Z_Prn_Text_TrueType_W(ByVal x As Integer, ByVal y As
Integer, ByVal FHeight As Integer, ByVal FWidth As Integer, ByVal
FType As String, ByVal Fspin As Integer, ByVal FWeight As Integer,
ByVal FItalic As Integer, ByVal FUnline As Integer, ByVal FStrikeOut
As Integer, ByVal id_name As String, ByVal data As String, ByVal
mem As Integer) As Integer
Declare Function Z_Prn_Text_TrueType_Uni(ByVal x As Integer, ByVal y As
Integer, ByVal FSize As Integer, ByVal FType As String, ByVal Fspin
As Integer, ByVal FWeight As Integer, ByVal FItalic As Integer, ByVal
FUnline As Integer, ByVal FStrikeOut As Integer, ByVal id_name As
String, ByVal data As Byte(), ByVal format As Integer, ByVal
mem_mode As Integer) As Integer
Declare Function Z_Prn_Text_TrueType_UniB(ByVal x As Integer, ByVal y
As Integer, ByVal FSize As Integer, ByVal FType As String, ByVal
Fspin As Integer, ByVal FWeight As Integer, ByVal FItalic As Integer,
ByVal FUnline As Integer, ByVal FStrikeOut As Integer, ByVal
id_name As String, ByVal data As Byte(), ByVal format As Integer,
ByVal mem_mode As Integer) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
FSize
[In] TrueType font size; unit: dot.
FHeight
[In] Font height; unit: dot.
FWidth
[In] Font width; unit: dot.
FSize / FHeight / FWidth = (dpi * point) / 72.
FType
[In] Name of TrueType font.
Fspin
[In] TrueType font rotation. 1 -> 0, 2 -> 90, 3 -> 180, 4 -> 270
FWeight
[In] TrueType font thickness.
0 and NULL is and 400 -> 400 Standard,
100 -> Extra fine, 200 -> Very fine,
300 -> Fine, 500 -> Normal,
600 -> Half-bold, 700 -> Bold,
800 -> Extra bold, 900 -> Boldface.
FItalic
[In] TrueType font set to Italic. 0 -> FALSE, 1 -> TRUE.
FUnline
[In] TrueType font set to underlined. 0 -> FALSE, 1 -> TRUE.
FStrikeOut
[In] TrueType font set to strikethrough. 0 -> FALSE, 1 -> TRUE.
id_name
[In] Provides a name to be stored in the printer for identification purposes;
can be call out graphic directlyretrieved via the Z_Load_Graphic()
function.
data
[In] Text content.

For Z_Prn_Text_TrueType_Uni() and Z_Prn_Text_TrueType_UniB(), the


encoding of input data string should be in UTF-8, UTF-16, or in
Unicode big endian format; the string must be terminated with 0.
format
[In] Encoding scheme used to decode Unicode data.
0 -> Determined by the BOM (byte order mark) in the string header.
1 -> UTF-16.
2 -> Unicode big endian.
3 -> UTF-8.
mem
[In] Storage location of graphics. 0 -> RAM 1 -> Flash Memory.
Note: Flash memory has a limited lifetime. It is recommended that data be
stored in RAM unless it will be reused.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
char *pbuf = new char[128];
Z_Prn_Text_TrueType(30, 100, 30, "Arial", 1, 400, 0, 0, 0, "AA", "TrueType
Font", 0); //save in printer.
Z_Prn_Text_TrueType_W(30, 160, 20, 20, "Times New Roman", 1, 400, 0,
0, 0, "AB", "TT_W: Multi-character test", 0);
Z_Prn_Text_TrueType_Uni(30, 220, 30, "Times New Roman", 1, 400, 0, 0,
0, "AC", L"TT_Uni: Multi-character test", 1, 0);//UTF-16
strcpy(pbuf, "\xFF\xFE");//UTF-16.
memcpy(&pbuf[2], (char *)L"TT_UniB: Multi-character test", 15*2);//copy
mutil byte.
Z_Prn_Text_TrueType_UniB(30, 280, 30, "Times New Roman", 1, 400, 0, 0,
0, "AD", pbuf, 0, 0);//Byte Order Mark.
VB: VBA:
Dim buff1(128) As Byte
Dim buff2() As Byte
Dim i As Long
Call Z_Prn_Text_TrueType(30, 100, 30, "Arial", 1, 400, 0, 0, 0, "AA",
"TrueType Font", 0) 'save in printer.
Call Z_Prn_Text_TrueType_W(30, 160, 20, 20, "Times New Roman", 1,
400, 0, 0, 0, "AB", "TT_W: Multi-character test", 0);
buff2 = StrConv("TT_Uni: Multi-character test", vbNarrow) 'Converts
UNICODE(wide characters) to single-byte characters.
For i = LBound(buff2) To UBound(buff2)
buff1(i) = buff2(i)
Next i
buff1(26) = 0 'null.
buff1(27) = 0
Call Z_Prn_Text_TrueType_Uni(30, 220, 30, "Times New Roman", 1, 400,
0, 0, 0, "AC", buff1(0), 1, 0) 'UTF-16
buff1(0) = 255 'UTF-16.
buff1(1) = 254
buff2 = StrConv("TT_UniB: Multi-character test", vbNarrow) 'Converts
UNICODE(wide characters) to single-byte characters.
For i = LBound(buff2) To UBound(buff2)
buff1(i + 2) = buff2(i)
Next i
buff1(30) = 0 'null.
buff1(31) = 0
Call Z_Prn_Text_TrueType_UniB(30, 280, 30, "Times New Roman", 1, 400,
0, 0, 0, "AD", buff1(0), 0, 0) 'Byte Order Mark.
VB.net:
Dim pbuf(128) As Byte
Dim encUnicode = System.Text.Encoding.Unicode
Call Z_Prn_Text_TrueType(30, 100, 30, "Arial", 1, 400, 0, 0, 0, "AA",
"TrueType Font", 0) 'save in printer.
Call Z_Prn_Text_TrueType_W(30, 160, 20, 20, "Times New Roman", 1,
400, 0, 0, 0, "AB", "TT_W: Multi-character test", 0);
Call Z_Prn_Text_TrueType_Uni(30, 220, 30, "Times New Roman", 1, 400,
0, 0, 0, "AC", L"TT_Uni: Multi-character test", 1, 0);//UTF-16
pbuf(0) = 255 'UTF-16.
pbuf(1) = 254
encUnicode.GetBytes("TT_UniB: Multi-character test", 0, 14, pbuf, 2) 'copy
mutil byte.
pbuf(30) = 0 'null.
pbuf(31) = 0
Call Z_Prn_Text_TrueType_UniB(30, 280, 30, "Times New Roman", 1, 400,
0, 0, 0, "AD", pbuf, 0, 0) 'Byte Order Mark.

Description: The Z_Prn_Text_TrueType() function prints a line of text in


TrueType font.
Z_Clear_Memory()To clear the data in the printer's RAM memory

Purpose: To clear the data in the printer's RAM memory.

Syntax:
VC:
void Z_Clear_Memory(void);
VB: VBA: VB.net:
Declare Sub Z_Clear_Memory()

Example:
VC:
Z_Clear_Memory();
VB: VBA: VB.net:
Call Z_Clear_Memory()

Description: The Z_Clear_Memory() function clears the graphics and soft


fonts in the printer's RAM memory. As graphic images and fonts will cause an
overflow when too many are stored in memory, under normal conditions this
function should be called before Print_Out().
When memory is filled with commands or other items, the printer will delete
previously loaded graphics and fonts. To avoid the improper deletions, this
function should be called before executing Z_Print_Out().
Z_Clear_MemoryEx()To clear the data in the printer's RAM and flash
memory

Purpose: To clear the data in the printer's RAM and flash memory.

Syntax:
VC:
void Z_Clear_MemoryEx(int nMode);
VB: VBA:
Declare Sub Z_Clear_MemoryEx(ByVal nMode As Long)
VB.net:
Declare Sub Z_Clear_MemoryEx(ByVal nMode As Integer)

Parameters:
nMode
[in] Clear location.
0 -> RAM, 1 -> Flash Memory.

Example:
VC:
Z_Clear_MemoryEx(0);
VB: VBA: VB.net:
Call Z_Clear_MemoryEx(0)

Description: The Z_Clear_MemoryEx() function clears the graphics and soft


fonts in the printer's RAM and flash memory. As graphic images and fonts will
cause an overflow when too many are stored in memory, under normal
conditions this function should be called before Print_Out().
When memory is filled with commands or other items, the printer will delete
previously loaded graphics and fonts. To avoid the improper deletions, this
function should be called before executing Z_Print_Out().
Z_Set_Backfeed()To set label backfeed distance

Purpose: To set label backfeed distance.

Syntax:
VC:
void Z_Set_Backfeed(int nDistance);
VB: VBA:
Declare Function Z_Set_Backfeed(ByVal nDistance As Long) As Long
VB.net:
Declare Function Z_Set_Backfeed(ByVal nDistance As Integer) As Integer

Parameters:
nDistance
[in] Sets label backfeed distance; valid range: 0 - 999. Unit: dot

Example:
VC:
Z_Set_Backfeed(204);
VB: VBA: VB.net:
Call Z_Set_Backfeed(204)

Description: The Z_Set_Backfeed() function allows the printer to release an


extra, short length of label paper.
Z_Set_Darkness()To set the heat level of the thermal print head

Purpose: To set the heat level of the thermal print head.

Syntax:
VC:
int Z_Set_Darkness(int darkness);
VB: VBA:
Declare Function Z_Set_Darkness(ByVal darkness As Long) As Long
VB.net:
Declare Function Z_Set_Darkness(ByVal darkness As Integer) As Integer

Parameters:
darkness
[in] Sets the heat level of the thermal print head; valid range: -30 - 30. Set
to 0 internally for the printer

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Darkness(12);
VB: VBA: VB.net:
Call Z_Set_Darkness(12)

Note: The Z_Set_Darkness() function controls the darkness of the image. To


obtain higher print quality, consider a number of other factors such as print
speed, paper media, ribbon types (wax, semi-resin and resin), and image
pattern itself. No single factor alone determines print quality.
Z_Set_DebugDialog()To set the debugging environment

Purpose: To set the debugging environment.

Syntax:
VC:
int Z_Set_DebugDialog(int nEnable);
VB: VBA:
Declare Function Z_Set_DebugDialog(ByVal nEnable As Long) As Long
VB.net:
Declare Function Z_Set_DebugDialog(ByVal nEnable As Integer) As
Integer

Parameters:
nEnable
[in]1 -> Debugging environment enabled.
0 -> Debugging environment disabled.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_DebugDialog(1);
VB: VBA: VB.net:
Call Z_Set_DebugDialog(1)

Description: The Z_Set_DebugDialog() function sets the debugging


environment; in addition to returning the error code, it may also display a
dialog box with warning messages, depending on the parameter values.
Z_Set_Label()To set paper length; this is required for continuous form
paper

Purpose: To set paper length; this is required for continuous form paper

Syntax:
VC:
int Z_Set_Label(int Length);
VB: VBA:
Declare Function Z_Set_Label(ByVal Length As Long) As Long
VB.net:
Declare Function Z_Set_Label(ByVal Length As Integer) As Integer

Parameters:
Length
[in] Length of continuous form paper; unit: pixel.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Label(300);
VB: VBA: VB.net:
Call Z_Set_Label(300)

Description: The Z_Set_Label() function sets the label's length.


Z_Set_Mode()To activate Cutter or Peel

Purpose: To activate Cutter or Peel.

Syntax:
VC:
int Z_Set_Mode(char mode);
VB: VBA:
Declare Function Z_Set_Mode(ByVal mode As Byte) As Long
VB.net:
Declare Function Z_Set_Mode(ByVal mode As Byte) As Integer

Parameters:
mode
[in]T: tear off.
P: peel off.
C: cutter enable.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Mode('C');
VB: VBA: VB.net:
Call Z_Set_Mode(Asc("C"))

Description: The Z_Set_Mode() function is an important configuration


function.
Z_Set_Origin()To set the Y-coordinate of the starting print position

Purpose: To set the Y-coordinate of the starting print position.

Syntax:
VC:
int Z_Set_Origin(int y);
VB: VBA:
Declare Function Z_Set_Origin(ByVal y As Long) As Long
VB.net:
Declare Function Z_Set_Origin(ByVal y As Integer) As Integer

Parameters:
y
[in] Y-coordinate of the starting print position.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Origin(10);
VB: VBA: VB.net:
Call Z_Set_Origin(10)

Description: The Z_Set_Origin() function sets the Y-coordinate of the starting


print position.
Z_Set_Paper()To set the paper as continuous or non-continuous label.

Purpose: To set the paper as continuous or non-continuous label.

Syntax:
VC:
int Z_Set_Paper(char mode);
VB: VBA:
Declare Function Z_Set_Paper(ByVal mode As Byte) As Long
VB.net:
Declare Function Z_Set_Paper(ByVal mode As Byte) As Integer

Parameters:
mode
[in] N: continuous label, Y: non-continuous label.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Paper('Y');
VB: VBA: VB.net:
Call Z_Set_Paper(Asc("Y"))

Description: The Z_Set_Paper() function sets the paper as continuous or non-


continuous label.
Z_Set_Prncomport()To set the serial port

Purpose: To set the serial port.

Syntax:
VC:
int Z_Set_Prncomport(int baud, int parity, int data, int stop);
VB: VBA:
Declare Function Z_Set_Prncomport(ByVal baud As Long, ByVal parity As
Long, ByVal data As Long, ByVal stop As Long) As Long
VB.net:
Declare Function Z_Set_Prncomport(ByVal baud As Integer, ByVal parity
As Integer, ByVal data As Integer, ByVal stop As Integer) As Integer

Parameters:
baud
[in] Baud rate.
2400 -> 2400 baud.
4800 -> 4800 baud.
9600 -> 9600 baud.
19200 -> 19200 baud.
38400 -> 38400 baud.
parity
[in]Parity.
0: none parity.
1: even parity.
2: odd parity.
data
[in] Data bit number, 7 or 8.
stop
[in] Stop bit number, 1 or 2.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Prncomport(9600, 0, 8, 1);
VB: VBA: VB.net:
Call Z_Set_Prncomport(9600, 0, 8, 1)

Description: The Z_Set_Prncomport() function sets the value of the printer's


serial port. If it is different from that of the PC, the connection with the PC
cannot be established. This function must executed before calling the
Print_Out() function, and executed on its own better.
Z_Set_Prncomport_PC()To set the PC serial port

Purpose: To set the PC serial port.

Syntax:
VC:
int Z_Set_Prncomport_PC(int nBaudRate, int nByteSize, int nParity, int
nStopBits, int nDsr, int nCts, int nXonXoff);
VB: VBA:
Declare Function Z_Set_Prncomport_PC(ByVal nBaudRate As Long, ByVal
nBytesSize As Long, ByVal nParity As Long, ByVal nStopBits As
Long, ByVal nDsr As Long, ByVal nCts As Long, ByVal nXonXoff As
Long) As Long
VB.net:
Declare Function Z_Set_Prncomport_PC(ByVal nBaudRate As Integer,
ByVal nBytesSize As Integer, ByVal nParity As Integer, ByVal
nStopBits As Integer, ByVal nDsr As Integer, ByVal nCts As Integer,
ByVal nXonXoff As Integer) As Integer

Parameters:
nBaudRate
[in] Baud rate; as shown in the table below:
1 -> 110 9 -> 19200
2 -> 300 10 -> 38400
3 -> 600 11 -> 56000
4 -> 1200 12 -> 57600
5 -> 2400 13 -> 115200
6 -> 4800 14 -> 128000
7 -> 9600 15 -> 256000
8 -> 14400 0 -> 9600
nByteSize
[in]Data bit number:
0 -> 7-bit data
7 -> 7-bit data
8 -> 8-bit data
nParity
[in] Parity; as shown in the table below:
0 -> none parity
1 -> even parity
2 -> odd parity
nStopBits
[in]Stop bit number:
0 -> 1 stop bit
1 -> 1 stop bit
2 -> 2 stop bits
nDsr
[in]Setup hardware flow control
1 -> DTR CONTROL HANDSHAKE;
0 -> DTR CONTROL ENABLE;
nCts
[in]Setup hardware flow control
1 -> RTS CONTROL HANDSHAKE;
0 -> RTS CONTROL ENABLE;
nXonXoff
[in]Setup software flow control
0 -> Enable;
1 -> Disable;

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Prncomport_PC(0, 0, 0, 0, 0, 0, 0);
VB: VBA: VB.net:
Call Z_Set_Prncomport_PC(0, 0, 0, 0, 0, 0, 0)

Description: This Z_Set_Prncomport_PC() functions sets the value of the PC


serial port. If it is different from that of the printer, the connection with the
printer will be unable to be established. This function must be executed prior
to calling the function Z_Print_Out().
Z_Set_Reset()To power on reset, and clear buffer and memory datarevert
to original factory settings .

Purpose: To power on reset, and clear buffer and memory data.

Syntax:
VC:
void Z_Set_Reset();
VB: VBA: VB.net:
Declare Sub Z_Set_Reset()

Example:
VC:
Z_Set_Reset();
VB: VBA: VB.net:
Call Z_Set_Reset()

Description: Calling the Z_Set_Reset() function will power on reset the printer,
and clear buffer and memory data’s parameters to their original factory default
values..
Z_Set_Speed()To set the printer's printing speed

Purpose: To set the printer's printing speed.

Syntax:
VC:
int Z_Set_Speed(int s);
VB: VBA:
Declare Function Z_Set_Speed(ByVal s As Long) As Long
VB.net:
Declare Function Z_Set_Speed(ByVal s As Integer) As Integer

Parameters:
s
[in]speed, Value: 1 ~ 6.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Speed(3);
VB: VBA: VB.net:
Call Z_Set_Speed(3)

Description: The Z_Set_Speed() function sets the printing speed.


Z_Set_TPH()To set the printer's transfer mode

Purpose: To set the printer's transfer mode.

Syntax:
VC:
int Z_Set_TPH(char m);
VB: VBA:
Declare Function Z_Set_TPH(ByVal m As Byte) As Long
VB.net:
Declare Function Z_Set_TPH(ByVal m As Byte) As Integer

Parameters:
m
[in] T: thermal transfer.
D: direct thermal.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_TPH('T');
VB: VBA: VB.net:
Call Z_Set_TPH(Asc("T"))

Description: The Z_Set_TPH() function is an important configuration function.


Z_Set_Unit()To set the unit of measurement to inches, millimeters or pixels

Purpose: Z_Set_Unit()To set the unit of measurement to inches, millimeters or


pixels

Syntax:
VC:
int Z_Set_Unit(char m);
VB: VBA:
Declare Function Z_Set_Unit(ByVal m As Byte) As Long
VB.net:
Declare Function Z_Set_Unit(ByVal m As Byte) As Integer

Parameters:
m
[in]D: pixels.
I: inches.
M: millimeters.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Unit('D');
VB: VBA: VB.net:
Call Z_Set_Unit(Asc("D"))

Description: The Z_Set_Unit() function changes the unit of measurement to


inches, millimeters or pixels.
Z_Set_Gap()To set the length of the gap

Purpose: To set the length of the gap.

Syntax:
VC:
int Z_Set_Gap(int nPattern, int gapLen);
VB: VBA:
Declare Function Z_Set_Gap(ByVal nPatern As Long, ByVal gapLen As
Long) As Long
VB.net:
Declare Function Z_Set_Gap(ByVal nPatern As Integer, ByVal gapLen As
Integer) As Integer

Parameters:
nPattern
[in]0 ~ 65535 (mm).
gapLen
[in]5 ~ 65535 (mm).

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Gap(30, 20);
VB: VBA: VB.net:
Call Z_Set_Gap(30, 20)

Description: The Z_Set_Gap() function sets the length of paper gap. This
function is used only when Gap > 5 mm and must be executed before
Z_Set_Label().
Z_Set_ProcessDlg()To open or close the progress dialog box

Purpose: To open or close the progress dialog box.

Syntax:
VC:
int Z_Set_ProcessDlg(int nShow);
VB: VBA:
Declare Function Z_Set_ProcessDlg(ByVal nShow As Long) As Long
VB.net:
Declare Function Z_Set_ProcessDlg(ByVal nShow As Integer) As Integer

Parameters:
nShow
[In] 0 -> Set to closed.
1 -> Set to open.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_ProcessDlg(1);
VB: VBA: VB.net:
Call Z_Set_ProcessDlg(1)

Description: The Z_Set_ProcessDlg() function can be used to open or close


the progress dialog box.
Z_Set_ErrorDlg()To open or close the retry inquiry dialog when transmitting
fail

Purpose: To open or close the retry inquiry dialog when transmitting fail.

Syntax:
VC:
int Z_Set_ErrorDlg(int nShow);
VB: VBA:
Declare Function Z_Set_ErrorDlg(ByVal nShow As Long) As Long
VB.net:
Declare Function Z_Set_ErrorDlg(ByVal nShow As Integer) As Integer

Parameters:
nShow
[In] 0 -> Set to closed.
1 -> Set to open.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_ErrorDlg(1);
VB: VBA: VB.net:
Call Z_Set_ErrorDlg(1)

Description: The Z_Set_ErrorDlg() function can be used to open or close the


retry inquiry dialog when transmitting fail.
Z_Bar2d_QRCode()To print QR Barcode

Purpose: To print QR Barcode.

Syntax:
VC:
int Z_Bar2d_QRCode(int x, int y, int nModel, int nMagni, int nErr_Cor, int
nInput, LPCTSTR data, int increase);
VB: VBA:
Declare Function Z_Bar2d_QRCode(ByVal x As Long, ByVal y As Long,
ByVal nModel As Long, ByVal nMagni As Long, ByVal nErr_Cor As
Long, ByVal nInput As Long, ByVal data As String, ByVal increase As
Long) As Long
VB.net:
Declare Function Z_Bar2d_QRCode(ByVal x As Integer, ByVal y As Integer,
ByVal nModel As Integer, ByVal nMagni As Integer, ByVal nErr_Cor
As Integer, ByVal nInput As Integer, ByVal data As String, ByVal
increase As Integer) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
nModel
[In] QR code type
1 --> original;
2 --> enhanced
nMagni
[in]Magnification Factor
1 --> on 150 dpi printers
2 --> on 200 dpi printers
3 --> on 300 dpi printers
4 --> through 10
nErr_Cor
[In] Error correction
1 --> Ultra Hight Reliability
2 --> Hight Reliability
3 --> Standard
4 --> Hight density
nInput
[in]1 --> Automatic
2 --> Manual
data
[In] Barcode data.
increase
[in] Increment.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Bar2d_QRCode(20, 20, 2, 2, 3, 1, "QR Code", 0);
VB: VBA: VB.net:
Call Z_Bar2d_QRCode(20, 20, 2, 2, 3, 1, "QR Code", 0)

Description: The Z_Bar2d_QRCode() function prints 2D Barcode QR code.


Z_Set_PrintWidth()To set the print area

Purpose: To set the print area.

Syntax:
VC:
int Z_Set_PrintWidth(int nDotWidth);
VB: VBA:
Declare Function Z_Set_PrintWidth(ByVal nDotWidth As Long) As Long
VB.net:
Declare Function Z_Set_PrintWidth(ByVal nDotWidth As Integer) As Integer

Parameters:
nDotWidth
[In] Maximum print area.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
int Z_Set_PrintWidth(406);
VB: VBA: VB.net:
Call Z_Set_PrintWidth(406)

Description: The Z_Set_PrintWidth() function sets the print area.


Z_Print_OutQuality()To print out all data

Purpose: To print out all data.

Syntax:
VC:
int Z_Print_OutQuality(int nTotal, int copies, int sets, int nPause);
VB: VBA:
Declare Function Z_Print_OutQuality(ByVal nTotal As Long, ByVal sets As
Long, ByVal copies As Long, ByVal nPause As Long) As Long
VB.net:
Declare Function Z_Print_OutQuality(ByVal nTotal As Integer, ByVal sets As
Integer, ByVal copies As Integer, ByVal nPause As Integer) As Integer

Parameters:
nTotal
[In] Total no. of labels printed.
sets
[in] Pause and cut value.
copies
[In] No. of copies to be printed for the same label.
nPause
[In] Whether to pause for each 'sets' of labels.
1 -> Yes, 0 -> No.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Print_OutQuality(1, 1, 1, 1);
VB: VBA: VB.net:
Call Z_Print_OutQuality(1, 1, 1, 1)

Description: The Z_Print_OutQuality() function sends all data to the printer.


This function should be called after all other functions and before
Z_ClosePrn().
Z_Set_Mirror()To enable or disable mirror mode

Purpose: To enable or disable mirror mode.

Syntax:
VC:
int Z_Set_Mirror(char d);
VB: VBA:
Declare Function Z_Set_Mirror (ByVal d As Byte) As Long
VB.net:
Declare Function Z_Set_Mirror (ByVal d As Byte) As Integer

Parameters:
d
[In] N -> Normal mode, Y -> Mirror mode.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_Mirror('Y');
VB: VBA: VB.net:
Call Z_Set_Mirror(Asc("Y"))

Description: The Z_Set_Mirror() function is used to enable or disable the


mirror mode. Wherever this function is called within the program code, all text,
barcodes or graphic images will set to regular or mirror mode according to the
settings. If this function is executed several times in the program, settings
made in the last function call will remain.
Z_Bar2d_RSS()To print an RSS barcode

Purpose: To print an RSS barcode.

Syntax:
VC:
int Z_Bar2d_RSS(int x, int y, char ori, int rtype, int mag, int height, int seg,
LPCTSTR data1, LPCTSTR data2);
VB: VBA:
Declare Function Z_Bar2d_RSS(ByVal x As Long, ByVal y As Long, ByVal
ori As Byte, ByVal rtype As Long, ByVal mag As Long, ByVal height
As Long, ByVal seg As Long, ByVal data1 As String, ByVal data2 As
String) As Long
VB.net:
Declare Function Z_Bar2d_RSS(ByVal x As Integer, ByVal y As Integer,
ByVal ori As Byte, ByVal rtype As Integer, ByVal mag As Integer,
ByVal height As Integer, ByVal seg As Integer, ByVal data1 As String,
ByVal data2 As String) As Integer

Parameters:
x
[in] X-coordinate; unit: pixel.
y
[in] Y-coordinate; unit: pixel.
ori
[In] Orientation.
N: 0°
B: 90°
I: 180°
R: 270°
rtype
[In] Barcode type.
1 -> RSS-14
2 -> RSS Truncated
3 -> RSS Stacked
4 -> RSS Stacked Omnidirectional
5 -> RSS Limited
6 -> RSS Expanded
(Default value: 1)
mag
[In] Magnification. Range: 1 - 10 (default: 1)
height
[In] Barcode height.
Minimum height of standard barcodes:
RSS-14 -> 33 pixels
RSS Stacked -> 13 pixels
RSS Truncated -> 13 pixels
RSS Stacked Omnidirectional -> 69 pixels
RSS Limited -> 10 pixels
RSS Expanded -> 34 pixels
seg
[In] Each column of barcode may contain the maximum number of data
segment; it is valid only for RSS Expanded barcodes and does not
apply to other types of RSS barcodes. Its valid values are even
numbers between 2 and 22 (default: 22).
data1
[In] Numeric data.
data2
[In] 2D barcode data.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Bar2d_RSS(100, 100, 'R', 6, 1, 34, 4, "1234567890", "RSS code");
VB: VBA: VB.net:
Call Z_Bar2d_RSS(100, 100, Asc("R"), 6, 1, 34, 4, "123456789012", "RSS
code")

Description: The Z_Bar2d_RSS() function prints out an RSS barcode.


Z_Set_EncryptionKey()Set the encryption key

Purpose: Set the encryption key.

Syntax:
VC:
int Z_Set_EncryptionKey(char encryptionKey[16]);
VB: VBA:
Declare Function Z_Set_EncryptionKey(ByVal encryptionKey As String) As
Long
VB.net:
Declare Function Z_Set_EncryptionKey(ByVal encryptionKey As String) As
Integer

Parameters:
encryptionKey
[in]The encryption key, the key needs 16 chars and the range from 0x21 to
0x7E.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
Z_Set_EncryptionKey("key-123456789000");
VB: VBA: VB.net:
Call Z_Set_EncryptionKey("key-123456789000")

Description: This function is used to set the encryption key value, and send
data immediate, and store in printer.
Z_Check_EncryptionKey()Check the encryption key correctness

Purpose: Check the encryption key correctness.

Syntax:
VC:
int Z_Check_EncryptionKey(char decodeKey[8], char encryptionKey[16] ,
DWORD dwTimeoutms);
VB: VBA:
Declare Function Z_Check_EncryptionKey(ByVal decodeKey As String,
ByVal encryptionKey As String, ByVal dwTimeoutms As Long) As
Long
VB.net:
Declare Function Z_Check_EncryptionKey(ByVal decodeKey As String,
ByVal encryptionKey As String, ByVal dwTimeoutms As ULong) As
Integer

Parameters:
decodeKey
[in]The decode key, the key needs 8 chars and the range from 0x21 to
0x7E.
encryptionKey
[in]The encryption key, the key needs 16 chars and the range from 0x21 to
0x7E.
dwTimeoutms
[in]This is timeout time. The max times to receive data, unit is ms.

Return values:
0 -> OK.
Reference ZW-Error.txt file.

Example:
VC:
int ret;
ret = Z_Check_EncryptionKey("test-par", "key-123456789000", 1000); //1
second.
VB: VBA:
Dim ret As Long
ret = Z_Check_EncryptionKey("test-par", "key-123456789000", 1000) '1
second.
VB.net:
Dim ret As Integer
ret = Z_Check_EncryptionKey("test-par", "key-123456789000", 1000) '1
second.

Description: This function is used to check the encryption key correctness.


After send the decodeKey string to printer, and calculate with the encryption
key in printer then return the result. Then to compare with that calculate with
the decodeKey and encryptionKey string is the same.

You might also like