Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.1 patch 766 git-svn-id: svn://10.65.10.50/trunk@14628 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			1063 lines
		
	
	
		
			37 KiB
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			1063 lines
		
	
	
		
			37 KiB
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
| /******************************************************************************
 | ||
| 	Module: ZWIN-CAPI.TXT
 | ||
|         All commands for PPLZ in Dynamic Link Library for Windows
 | ||
| 	Notices: Copyright (c) 2001-2006 ARGOIMPREX
 | ||
| 	Version: 3.04ZW 2006/02/15
 | ||
| ******************************************************************************/
 | ||
| 	目錄
 | ||
| ===============================================================================
 | ||
| 	Z_Bar2d_Maxi()		=> 印出一個 Maxi Code 2D Barcode。
 | ||
| 	Z_Bar2d_PDF417()		=> 印出一個 PDF417 
 | ||
| 	Z_ClosePrn()            => 關閉 Printer 工作。
 | ||
| 	Z_CreatePrn()           => 開啟 Printer 工作。
 | ||
| 	Z_Set_FlashMemory()	=> 設定 FORM 儲存在 RAM 或 Flash Memory
 | ||
| 	Z_Set_Format_New()	=> 設定 FORM 名稱
 | ||
| 	Z_Del_Format()		=> 刪除 Form (表格)。
 | ||
| 	Z_Del_Graphic()         => 刪除儲存在印表機 RAM 或 Flash Memory 內的圖形。
 | ||
| 	Z_Draw_Box()            => 畫一個框。
 | ||
| 	Z_Draw_Line()           => 畫一條線。
 | ||
| 	Z_Get_DLL_Version()	=> 取得或秀出此函數庫版本資訊。
 | ||
| 	Z_Get_DLL_VersionA()	=> 取得或秀出此函數庫版本資訊。
 | ||
| 	Z_Get_Graphic_ColorBMP()=> 列印灰階 BMP 圖檔。
 | ||
| 	Z_Initial_Setting()     => 前置處理。
 | ||
| 	Z_Load_Graphic()	=> 列印一個圖形。
 | ||
| 	Z_Open_ChineseFont()	=> 開啟使用中文點矩陣字型檔案 (16*15 和 24*24)。    
 | ||
| 	Z_Print_Form()		=> 列印一個 FORM (表格),並輸入 FORM 的名稱,並設定寬及
 | ||
|                                    高的比例和跳號次數與列印份數。
 | ||
| 	Z_Print_Out()           => 輸出所有資料並設定寬及高的比例和跳號次數與列印份數。
 | ||
| 	Z_Prn_Barcode()		=> 印出一個條碼。
 | ||
| 	Z_Prn_Text()		=> 印出一行文字。
 | ||
| 	Z_Prn_Text_Chinese()    => 印出一行文字,使用中文點矩陣字型檔案 (16*15 或 24*24)。
 | ||
| 	Z_Prn_Text_TrueType()   => 印出一行 True Type Font 文字。
 | ||
| 	Z_Prn_Text_TrueType_W()	=> 印出一行 True Type Font 文字,並控制字型的寬及高。
 | ||
| 	Z_Clear_Memory()	=> 清除 Printer 內 RAM 及 Flash Memory 的資料。
 | ||
| 	Z_Set_Backfeed()	=> 標籤回收停止。
 | ||
| 	Z_Set_Darkness()	=> 設定熱感頭列印熱度。
 | ||
| 	Z_Set_DebugDialog()	=> 設定除錯環境。
 | ||
| 	Z_Set_Label()		=> 設定紙張長度
 | ||
| 	Z_Set_Mode()		=> 啟動 Cutter 或 Peel。
 | ||
| 	Z_Set_Origin()		=> 設定開始列印位置
 | ||
| 	Z_Set_Paper()		=> 設定為連續紙張
 | ||
| 	Z_Set_Prncomport	=> 設定印表機序列埠
 | ||
| 	Z_Set_Prncomport_PC()	=> 設定 PC 序列埠。
 | ||
| 	Z_Set_Reset()		=> 回復工廠設定
 | ||
| 	Z_Set_Speed()		=> 設定列印速度
 | ||
| 	Z_Set_TPH()		=> 設定轉印模式
 | ||
| 	Z_Set_Unit()		=> 設定度量單位為英吋或公尺或像素
 | ||
| 	Z_Set_Gap()		=> 設定 Gap 長度
 | ||
| 	Z_Set_ProcessDlg()	=> 開啟或關閉進度對話框
 | ||
| 	Z_Bar2d_QRCode()	=> 2D Barcode QR code 列印
 | ||
| 	Z_Set_PrintWidth()	=> 設定列印寬度
 | ||
| 	Z_Print_OutQuality	=> 設定列印張數
 | ||
| 	Z_GetUSBBufferLen()	=> 查詢 USB 埠資料長度
 | ||
| 	Z_EnumUSB()			=> 取得 USB 埠的資料
 | ||
| 	Z_CreateUSBPort()	=> 使用 USB 埠進行傳輸
 | ||
| 
 | ||
| *******************************************************************************
 | ||
|     注意事項
 | ||
| ===============================================================================
 | ||
|     使用方法:1.將 WINPPLZ.DLL 及 WCOMMON.DLL 加入 \\Windows\system\ 或 \\???\
 | ||
| 	        執行中路徑,才能被搜尋到。
 | ||
| 	      2.以下範例為 Visual C++ 的範例,其他程式語言不一定完全相同
 | ||
| 
 | ||
|     *******************************************************************************
 | ||
|     Z_GetUSBBufferLen()
 | ||
| 	Z_EnumUSB()
 | ||
|     ===============================================================================
 | ||
| 	功能:	取得 USB Printer 的資料。
 | ||
| 
 | ||
| 	語法:	int Z_GetUSBBufferLen();
 | ||
| 			int Z_EnumUSB(char *buf);
 | ||
| 
 | ||
| 	參數:	char *buf;	●儲存 USB Printer 資料。
 | ||
| 
 | ||
| 
 | ||
| 	傳回值:	Z_GetUSBBufferLen(); 傳回 USB 的資料長度
 | ||
| 				Z_EnumUSB()	0 -> OK.
 | ||
| 							Reference AW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	char *buf;
 | ||
| 			int	nLen = Z_GetUSBBufferLen()+1;
 | ||
| 			buf = malloc(nLen);
 | ||
| 			memset(buf, 0, nLen);
 | ||
| 			Z_EnumUSB(buf);
 | ||
| 
 | ||
| 	說明:	這兩個函數是一組的函數。先用 Z_GetUSBBufferLen() 取得 USB 傳輸埠的資料
 | ||
| 			長度, 然後再配記憶體給 Z_EnumUSB() 儲存 USB 埠的資料。USB 埠的資料是以
 | ||
| 			("0x0d0x0a")做分隔,舉例來說, 如果資料是 A-200(0x0d)(0x0a)R-400ZIP 的話
 | ||
| 			表示 USB1 是接 A-200, USB2 是接 R-400Zip。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_CreatePrn()
 | ||
| 	Z_CreateUSBPort()
 | ||
| ===============================================================================
 | ||
| 	功能:	開啟 Printer 工作。
 | ||
| 
 | ||
| 	語法:	int Z_CreatePrn(int selection,LPCTSTR filename);
 | ||
| 			int Z_CreateUSBPort(int nPort);
 | ||
| 
 | ||
| 	參數:	int	selection;	選擇輸出埠或檔案。
 | ||
| 					0 -> print to file.
 | ||
| 					1 -> lpt1, 2 -> lpt2, 3 -> lpt3
 | ||
| 					4 -> com1, 5 -> com2, 6 -> com3
 | ||
| 					10 -> net
 | ||
| 		LPCTSTR	filename;	當 selection 內容是 0 時資料則輸出至檔
 | ||
| 					案,檔名就是 filename 內容,可含路徑,
 | ||
| 					或是 NULL。當 selection 內容是 10 時,
 | ||
| 					filename 為輸出路徑。
 | ||
| 			int	nPort;			● USB 傳輸埠
 | ||
| 
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_CreatePrn(1,NULL); 或 Z_CreatePrn(0,"C:\TEMP\out.prn");
 | ||
| 		Z_CreatePrn(10,"\\allen\Label"); 或 Z_CreateUSBPort(1);
 | ||
| 
 | ||
| 	說明:	Z_CreatePrn 和 Z_CreateUSBPort 函數會開啟你選擇的輸出埠或開啟你鍵入的
 | ||
| 		輸出檔。而這個函數必須在所有函數之前執行。
 | ||
| 		Z_CreatePrn 和 Z_CreateUSBPort 不能同時使用。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_ClosePrn()
 | ||
| ===============================================================================
 | ||
| 	功能:	關閉 Printer 工作。
 | ||
| 
 | ||
| 	語法:	void Z_ClosePrn(void);
 | ||
| 
 | ||
| 	範例:	Z_ClosePrn();
 | ||
| 
 | ||
| 	說明:	這個 Z_ClosePrn 函數會關閉執行過的記憶體及你選擇的輸出埠或關閉你開啟的
 | ||
| 		輸出檔。而這個函數必須在所有函數之後執行。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
|     Z_Bar2d_Maxi()
 | ||
| ===============================================================================
 | ||
| 	功能:	印出一個 Maxi Code 2D Barcode。
 | ||
| 
 | ||
| 	語法: 	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)
 | ||
| 
 | ||
| 	參數:	int		x		X座標
 | ||
| 		int		y		Y座標.1 dot = 0.125 mm
 | ||
| 		int		nMode		Barcode mode
 | ||
| 						2: Numeric Postal Code(US)
 | ||
| 						3: Alphanumeric Postal Code(Non-US)
 | ||
| 		int		nSymbol		Symbol Number: 1 ~ 8
 | ||
| 		int		nTotal		Symbol Number 總數: 1 ~ 8
 | ||
| 		int		nClass		three digit class of service
 | ||
| 		int		nCountry	three digit country code
 | ||
| 		char		cZipCode1[6]	nMode = 2 --> five digit zip code
 | ||
| 						nMode = 3 --> six character zip code
 | ||
| 		char		cZipCode2	four digit zip code externsion.
 | ||
| 						*Only Used in nMode 2.
 | ||
| 		LPCTSTR		data		資料字串,最多84個字元
 | ||
| 		int		increase	增量,預設值為0
 | ||
| 
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	int	x,y,m,n,t,increase;
 | ||
| 		LPCTSTR	data="This MaxiCode";
 | ||
| 			x=50;y=50;m=4;n=4;t=5,increase=0;
 | ||
| 		Z_Bar2d_Maxi(x,y,m,n,t,data,increase);
 | ||
| 
 | ||
| 	說明:	這個 Z_Bar2d_Maxi 函數可以列印出一個 Maxi Code 2D Barcode。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
|     Z_Bar2d_PDF417()
 | ||
| ===============================================================================
 | ||
| 	功能:	印出一個 PDF417 2D Barcode。
 | ||
| 
 | ||
| 	語法: 	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)
 | ||
| 
 | ||
| 	參數:	int		x		X座標
 | ||
| 		int		y		Y座標.1 dot = 0.125 mm
 | ||
| 		int		o		列印方向定位,'1'是 0°,'2'是90°、
 | ||
| 						'3'是180°,'4'是270°
 | ||
| 		int		h		Barcode height for Individual Rows
 | ||
| 						h * module = height of individusl rows
 | ||
| 		int		s		錯誤校正等級 0~8
 | ||
| 		int		c		column count
 | ||
| 		int		r		row count
 | ||
| 		int		t		Truncation flag,
 | ||
| 						'0' 是 normal 和 '1' 是 truncated.
 | ||
| 		int		narrow		模組高度
 | ||
| 		LPCTSTR		data		資料字串,最多84個字元
 | ||
| 		int		increase	增量,預設值為0
 | ||
| 
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	int	x,y,o,h,s,c,r,t,narrow,increase;
 | ||
| 		LPCTSTR	data="PDF-417";
 | ||
| 			x=50;y=50;o=0;h=5;s=5;c=2;r=83;t=0;increase=0;narrow=2;
 | ||
| 		Z_Bar2d_PDF417(x,y,o,h,s,c,r,t,narrow,data,increase);
 | ||
| 
 | ||
| 	說明:	這個 Z_Bar2d_PDF417 函數可以列印出一個 PDF417 2D Barcode。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_FlashMemory()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定 FORM 儲存位置
 | ||
| 
 | ||
| 	語法:	int Z_Set_FlashMemory(int Status);
 | ||
| 
 | ||
| 	參數:	int	Status;		儲存位置
 | ||
| 					0 -> RAM	1 -> Flash Memory
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_FlashMemory(0); 或 Z_Set_FlashMemory(1);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_FlashMemory 設定 FORM 儲存位置。在使用 FORM 前,須先
 | ||
| 		執行 Z_Set_FlashMemory()
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Format_New()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定 FORM (表格) 名稱
 | ||
| 
 | ||
| 	語法:	void Z_Set_Format_New(LPCTSTR FormName);
 | ||
| 
 | ||
| 	參數:	LPCTSTR		FormName;	表格名稱。
 | ||
| 
 | ||
| 	範例:	Z_Set_Format_New("demo");
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Format_New 設定 FORM (表格) 名稱。在設定之後,可直
 | ||
| 		接呼叫 FORM 列印
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Del_Format()
 | ||
| ===============================================================================
 | ||
| 	功能:	刪除 FORM (表格)
 | ||
| 
 | ||
| 	語法:	int Z_Del_Format(int memory, char FormName[])
 | ||
| 
 | ||
| 	參數:	int	memory;		儲存位置
 | ||
| 					0 -> RAM	1 -> Flash Memory
 | ||
| 		char	FormName[];	表格名稱。不可超過10字
 | ||
| 
 | ||
| 	範例:	Z_Del_Format(0,"demo");
 | ||
| 
 | ||
| 	說明:	這個 Z_Del_Format 可刪除儲存印表機內 FORM (表格)。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Del_Graphic()
 | ||
| ===============================================================================
 | ||
| 	功能:	刪除儲存在印表機 RAM 或 Flash Memory 內的圖形
 | ||
| 
 | ||
| 	語法:	int Z_Del_Graphic(int memory, char GraphicName[])
 | ||
| 
 | ||
| 	參數:	int	memory;		儲存位置
 | ||
| 					0 -> RAM	1 -> Flash Memory
 | ||
| 		char	GraphicName[];	圖形名稱。不可超過10字
 | ||
| 
 | ||
| 	範例:	Z_Del_Graphic(0,"girl");
 | ||
| 
 | ||
| 	說明:	這個 Z_Del_Graphic 可刪除儲存印表機內的圖形
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Draw_Box()
 | ||
| ===============================================================================
 | ||
| 	功能:	畫一個框
 | ||
| 
 | ||
| 	語法:	int Z_Draw_Box(int x,int y,int width,int height,int thickness)
 | ||
| 
 | ||
| 	參數:	int	x;		X座標
 | ||
| 		int	y;		Y座標
 | ||
| 		int	width;		框的長度 0 < width < 9999
 | ||
| 		int	height		框的寬度 0 < height < 9999
 | ||
| 		int	thickness	線條的粗細 > 0
 | ||
| 					備註:1 dot = 0.125 mm。
 | ||
| 
 | ||
| 	範例:	int x,y,,width,height,thickness;
 | ||
| 		x=50;y=100;width=250;height=100;thickness=5;
 | ||
| 		Z_Draw_Box(x,y,width,height,thickness);
 | ||
| 	說明:	這個 Z_Draw_Box 函數會畫一個框
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Draw_Line()
 | ||
| ===============================================================================
 | ||
| 	功能:	畫一條線
 | ||
| 
 | ||
| 	語法:	int Z_Draw_Line(int x,int y,int width,int height)
 | ||
| 
 | ||
| 	參數:	int	x;		X座標
 | ||
| 		int	y;		Y座標
 | ||
| 		int	width;		線的長度 0 < width < 9999
 | ||
| 		int	height		線的寬度 0 < height < 9999
 | ||
| 					備註:1 dot = 0.125 mm。
 | ||
| 
 | ||
| 	範例:	int x,y,,width,height;
 | ||
| 		x=50;y=100;width=250;height=3;
 | ||
| 		Z_Draw_Box(x,y,width,height);
 | ||
| 	說明:	這個 Z_Draw_Line 函數會畫一條線
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Get_DLL_Version()
 | ||
| 	Z_Get_DLL_VersionA()
 | ||
| ===============================================================================
 | ||
| 	功能:	取得或秀出此函數庫版本資訊。
 | ||
| 
 | ||
| 	語法:	char* Z_Get_DLL_Version(int nShowMessage); 
 | ||
| 		int Z_Get_DLL_VersionA(int nShowMessage); 
 | ||
| 
 | ||
| 	參數:	int	nShowMessage;		訊息視窗顯現。0 -> 不顯現、1 -> 顯現。
 | ||
| 
 | ||
| 	傳回值:	傳回版本資訊字串,失敗則傳回 NULL。
 | ||
| 		Z_Get_DLL_VersionA() -> return version value.
 | ||
| 
 | ||
| 	範例:	Z_Get_DLL_Version(1);
 | ||
| 
 | ||
| 	說明:	這個 Z_Get_DLL_Version 函數,讓使用者取得或秀出此函數庫版本資訊。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Get_Graphic_ColorBMP()
 | ||
| ===============================================================================
 | ||
| 	功能:	轉換 BMP 圖檔彩色變灰階,並將圖形儲存在印表機內的 RAM 或
 | ||
| 		Flash Memory。
 | ||
| 
 | ||
| 	語法:	int Z_Get_Graphic_ColorBMP(int x, int y,int memory, LPCTSTR filename);
 | ||
| 
 | ||
| 	參數:	int	x;		X 座標。
 | ||
| 		int	y;		Y 座標。
 | ||
| 		int	memory;		儲存位置 0 -> RAM	1 -> Flash Memory
 | ||
| 		LPCTSTR	filename;	圖形檔名稱,可含路徑。
 | ||
| 					格式如:XXXXXXXX.XXX 或 X:\XXX\XXX.BMP
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Get_Graphic_ColorBMP(30,20,"girl.bmp");
 | ||
| 
 | ||
| 	說明:	這個 Z_Get_Graphic_ColorBMP 函數可輸入任何顏色 BMP 圖檔,並自動轉換為
 | ||
| 		黑白灰階圖檔送至印表機列印,而轉換品質由 Windows's Driver for Dr.200
 | ||
| 		or Dr.300 調整,所以使用者必需安裝 ARGOX Driver,印表機抓取為預設印表機,
 | ||
| 		假若 default printer 不是 Dr.200 或 Dr.300 ,程式自動搜尋 Windows 內,
 | ||
| 		是否有裝 Dr.200 或 Dr.300,再依序使用。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Initial_Setting()
 | ||
| ===============================================================================
 | ||
| 	功能:	前置處理。
 | ||
| 
 | ||
| 	語法:	int Z_Initial_Setting(int Type,LPCTSTR Source);
 | ||
| 
 | ||
| 	參數:	int	Type;		選擇輸入模式,值為 0 -> 輸入字串,
 | ||
| 					1 -> 輸入檔案。
 | ||
| 		LPCTSTR	Source;		資料來源,可為字串或檔案名稱,可含路徑。
 | ||
|                                            
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:  LPCTSTR aa = "^FO120,30\r\n\"; Z_Initial_Setting(0,aa);
 | ||
| 			or
 | ||
| 		Z_Initial_Setting(1,"initfile.txt");
 | ||
| 
 | ||
| 	說明:	這個 Z_Initial_Setting 函數前置處理的動作,是將一串 Command 先送至印表
 | ||
| 		機,由字串或檔案輸入,在使用這個函數時,須先在 Z_Create_Prn() 之後其他
 | ||
| 		函數之前,可作為使用者自訂型態。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Load_Graphic()
 | ||
| ===============================================================================
 | ||
| 	功能:	列印一個圖形。
 | ||
| 
 | ||
| 	語法:	int Z_Load_Graphic(int x,int y,char GraName[11],int hori,int vert);
 | ||
| 
 | ||
| 	參數:	int	x;		X 座標。
 | ||
| 		int	y;		Y 座標。備註:1 dot = 0.125 mm。
 | ||
| 		char	GraName[11];	圖形檔名稱,(不含副檔名)最大10個字元。
 | ||
| 		int	hori;		垂直放大倍數. 1 <= hori <= 10 預設為1
 | ||
| 		int	vert;		水平放大倍數. 1 <= vert <= 10 預設為1
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	int	x,y,hori,vert;
 | ||
| 		char	GraName[11]="phone";
 | ||
| 		x=50;y=30,hori=1,vert=1;
 | ||
| 		Z_Load_Graphic(x,y,GraName,hori,vert);
 | ||
| 
 | ||
| 	說明:	這個 Z_Load_Graphic 函數會列印一個圖形,而圖形必須先執行
 | ||
| 		Z_Get_Graphic 載入印表機內的 RAM 或 flash memory。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Open_ChineseFont()
 | ||
| ===============================================================================
 | ||
| 	功能:	開啟使用中文點矩陣字型檔案 (16*15 和 24*24)。
 | ||
| 
 | ||
| 	語法:	int Z_Open_ChineseFont(char* path);
 | ||
| 
 | ||
| 	參數:	char*	path;		中文點矩陣字型檔案來源路徑。
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Open_ChineseFont("C:\\ET3");
 | ||
| 
 | ||
| 	說明:	這個 Z_Open_ChineseFont 函數開啟中文點矩陣字型檔案 (16*15 和 24*24),
 | ||
| 		供 Z_Prn_Text_Chinese 函數使用。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Print_Form()
 | ||
| ===============================================================================
 | ||
| 	功能:	列印一個 FORM (表格),並輸入 FORM 的名稱,並設定跳號次數與列
 | ||
| 		印份數。
 | ||
| 
 | ||
| 	語法:	int Z_Print_Form(int labset,int copies,int mem,char form_out[]);
 | ||
| 
 | ||
| 	參數:	int	labset;		列印的份數,範圍:1~32767。
 | ||
| 		int	copies;		複製的份數,範圍:1~32767。
 | ||
| 		int	mem;		儲存位置 0 -> RAM	1 -> Flash Memory
 | ||
| 		char   form_out[11];	表格名稱,同於之前載入的 FORM 名稱,
 | ||
| 					或原先儲存在印表機內的 FORM。
 | ||
| 
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	int    labset,copies,mem;
 | ||
| 		char   form_out[11]="demo";
 | ||
| 		labset=3;copypiece=2,mem=0;
 | ||
| 		Z_Print_form(labset,copies,mem,form_out);
 | ||
| 
 | ||
| 	說明:	這個 Z_Print_Form 函數會送所有資料及表格到 Printer,這個函數使用前
 | ||
| 		須先執行 Z_Set_Format_New(),並在所有函數之後,Z_ClosePrn() 之前執行。當
 | ||
| 		使用此函數時,就不須執行 Z_Print_Out()。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Print_Out()
 | ||
| ===============================================================================
 | ||
| 	功能:	列印所有資料。
 | ||
| 
 | ||
| 	語法:	int Z_Print_Out(int set,sint copies);
 | ||
| 
 | ||
| 	參數:	int	sets;		要列印的幾組
 | ||
| 		int	copies;		資料列印份數
 | ||
| 
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Print_Out(1,1);
 | ||
| 
 | ||
| 	說明:	這個 Z_Print_Out 函數會送所有資料到 Printer,這個函數須在所有函數之
 | ||
| 		後,Z_ClosePrn() 之前執行。
 | ||
| *******************************************************************************
 | ||
| 	Z_Prn_Barcode()
 | ||
| ===============================================================================
 | ||
| 	功能:	印出一個條碼和加上跳號功能。
 | ||
| 
 | ||
| 	語法:	Z_Prn_Barcode(int x,int y,int ori,int narrow,int width,
 | ||
| 			int height,char type,int increase,LPCTSTR data,char p1,
 | ||
| 			char p2,char p3,char p4,char p5)
 | ||
| 
 | ||
| 	參數:	int	x;		X 座標。
 | ||
| 		int	y;		Y 座標。
 | ||
| 					備註:200 dpi => 1 dot = 0.125 mm。
 | ||
| 		int	ori;		列印方向定位,'1'是 0°,'2'是90°、
 | ||
| 					'3'是180°,'4'是270°
 | ||
| 		int	narrow		NARROW bar 寬度
 | ||
| 		int	width		WIDE bar 寬度
 | ||
| 		int	height		Bar code 高度
 | ||
| 		char	type;		Bar code 型式、如下表:
 | ||
|     ╒══╤══════════════╤═════════════════╕
 | ||
|     │type│        條碼種類            │          使  用  參  數          │
 | ||
|     ╞══╪══════════════╪═════════════════╡
 | ||
|     │    │                            │p1:確認碼   Y:1位數  N:2位數      │
 | ||
|     │ 1  │Code 11                     │p2:是否列印條碼資料               │
 | ||
|     │    │                            │p3:條碼資料是否列印在 Barcode 上方│
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │    │                            │p1:是否列印條碼資料               │
 | ||
|     │ 2  │Interleaved 2 of 5          │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     │    │                            │p3:是否列印確認碼                 │
 | ||
|     ├──┼──────────────┼──┼──────────────┤
 | ||
|     │    │                            │p1:是否列印確認碼                 │
 | ||
|     │ 3  │Code 39                     │p2:是否列印條碼資料               │
 | ||
|     │    │                            │p3:條碼資料是否列印在 Barcode 上方│
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │ 8  │EAN-8                       │p1:是否列印條碼資料               │
 | ||
|     │    │                            │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │    │                            │p1:是否列印條碼資料               │
 | ||
|     │ 9  │UPC-E                       │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     │    │                            │p3:是否列印確認碼                 │
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │    │                            │p1:是否列印條碼資料               │
 | ||
|     │ A  │Code93                      │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     │    │                            │p3:是否列印確認碼                 │
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │    │                            │p1:是否列印條碼資料               │
 | ||
|     │    │                            │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     │ C  │Code 128 Subset A,B,C       │p3:是否列印UCC確認碼              │
 | ||
|     │    │Code 128 UCC                │p4:Code 128 subset A,B,C 或       │
 | ||
|     │    │                            │   Code 128 UCC                   │
 | ||
|     │    │                            │   N:Code 128   U:Code 128 UCC    │
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │ E  │EAN-13                      │p1:是否列印條碼資料               │
 | ||
|     │    │                            │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │ I  │Industrial 2 of 5           │p1:是否列印條碼資料               │
 | ||
|     │    │                            │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │ J  │Standard 2 of 5             │p1:是否列印條碼資料               │
 | ||
|     │    │                            │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │    │                            │p1:是否列印確認碼                 │
 | ||
|     │    │                            │p2:是否列印條碼資料               │
 | ||
|     │ K  │ANSI Codabar                │p3:條碼資料是否列印在 Barcode 上方│
 | ||
|     │    │                            │p4:開始字元                       │
 | ||
|     │    │                            │p5:結束字元                       │
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │ L  │LOGMARS Code                │p1:條碼資料是否列印在 Barcode 上方│
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │    │                            │p1:確認碼  A:無確認碼             │
 | ||
|     │    │                            │           B:1 Mod 10             │
 | ||
|     │    │                            │           C:2 Mod 10             │
 | ||
|     │ M  │MSI Code                    │           D:1 Mod 10 and 1 Mod 11│
 | ||
|     │    │                            │p2:是否列印條碼資料               │
 | ||
|     │    │                            │p3:條碼資料是否列印在 Barcode 上方│
 | ||
|     │    │                            │p4:條碼資料是否列印確認碼         │
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │ S  │UPC/EAN Extensions          │p1:是否列印條碼資料               │
 | ||
|     │    │                            │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │    │                            │p1:是否列印條碼資料               │
 | ||
|     │ U  │UPC-A Code                  │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     │    │                            │p3:是否列印確認碼                 │
 | ||
|     ├──┼──────────────┼─────────────────┤
 | ||
|     │ Z  │POSTENET Code               │p1:是否列印條碼資料               │
 | ||
|     │    │                            │p2:條碼資料是否列印在 Barcode 上方│
 | ||
|     └──┴──────────────┴─────────────────┘
 | ||
| 			備註:p1,p2,p3,p4,p5 未註明,Y:列印  N:不列印
 | ||
| 			     如未使用到則可任意輸入值
 | ||
| 
 | ||
| 		int	increase	增量
 | ||
| 		LPCTSTR	data		資料字串
 | ||
| 		char	p1,p2,p3,p4,p5	視 Barcode 的不同,有不同的意義
 | ||
| 
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Prn_Barcode(650,15,0,2,2,51,'C',0,"1234567",'Y','N','N','N','N');
 | ||
| 
 | ||
| 	說明:	這個 Z_Prn_Barcode 函數可以列印出一個特定 Barcode
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Prn_Text()
 | ||
| ===============================================================================
 | ||
| 	功能:	印出一行文字和加上跳號功能。
 | ||
| 
 | ||
| 	語法:	int Z_Prn_Text(int x,int y,int ori,char font,int height,
 | ||
| 			int width,int increase,LPCTSTR data);
 | ||
| 
 | ||
| 	參數:	int	x;		X 座標。
 | ||
| 		int	y;		Y 座標。備註:1 dot = 0.125 mm。
 | ||
| 		int	ori;		列印方向定位,'1'是 0°,'2'是90°、
 | ||
| 					'3'是180°,'4'是270°
 | ||
| 		char	font;		選擇字形    A~H:點陣字形
 | ||
| 						    0,P~V:線性字形
 | ||
| 					點陣字大小:
 | ||
| 					╒══╤════╕
 | ||
| 					│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│
 | ||
| 					└──┴────┘
 | ||
| 		int	height;		水平放大
 | ||
| 		int	width;		垂直放大
 | ||
| 					font A~H 則輸入 Font Size 倍數,最大值為 10 倍
 | ||
| 					font 0,P~V 則表示點數,範圍:1~1500
 | ||
| 					     但各字形最大值各有不同
 | ||
| 
 | ||
| 		int	increase;	增量
 | ||
| 		LPCTSTR	data;		資料字串
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Prn_Text(50,110,0,'A',90,50,0,"A123456"); 點陣字形
 | ||
| 			or
 | ||
| 		Z_Prn_Text(50,110,0,'P',27,360,0,"A123456"); 線性字形
 | ||
| 
 | ||
| 	說明:	這個 Z_Prn_Text 函數可以列印出一行文字和加上跳號功能。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Prn_Text_Chinese()
 | ||
| ===============================================================================
 | ||
| 	功能:	印出一行文字,使用中文點矩陣字型檔案 (16*15 或 24*24)。
 | ||
| 
 | ||
| 	語法:	int Z_Prn_Text_Chinese(int x,int y,int fonttype,
 | ||
| 			LPCTSTR id_name,LPCTSTR data,int mem);
 | ||
|       
 | ||
| 	參數:	int	x;		X 座標。(dot)
 | ||
| 		int	y;		Y 座標。(dot)
 | ||
| 		int	fonttype;	矩陣字型選擇。
 | ||
| 					0 -> 16*15、1 -> 24*24。
 | ||
| 		LPCTSTR	id_name;	給予一個識別名稱存放於印表機內,以後直
 | ||
| 					接使用 Z_Load_Graphic() 即可將舊圖呼叫出來。
 | ||
| 		LPCTSTR	data;		文字內容。
 | ||
| 		int	mem		圖形儲存位置 0 -> RAM	1 -> Flash Memory
 | ||
|         
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Open_ChineseFont("C:\\ET3");
 | ||
| 		Z_Prn_Text_Chinese(100, 100, 0,"A01","國家利益當前AbCcDd",0);
 | ||
| 
 | ||
| 	說明:	這個 Z_Prn_Text_Chinese 函數可以印出一行文字,使用中文點矩陣字型檔案
 | ||
| 		(16*15 或 24*24)。
 | ||
| 		但須先安裝 Window's Driver for Dr.200 or Dr.300,濃淡從 driver 設定,
 | ||
| 		印表機抓取為預設印表機,假若default printer 不是 Dr.200 或 Dr.300 ,
 | ||
| 		程式自動搜尋 Windows 內,是否有裝 Dr.200 或 Dr.300,再依序使用。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Prn_Text_TrueType()
 | ||
| 	Z_Prn_Text_TrueType_W()
 | ||
| ===============================================================================
 | ||
| 	功能:	印出一行 True Type Font 文字。
 | ||
| 
 | ||
| 	語法:	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);
 | ||
| 		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);
 | ||
| 									      
 | ||
| 	參數:	int	x;		X 座標。
 | ||
| 		int	y;		Y 座標。備註:1 dot = 0.125 mm。
 | ||
| 		int	FSize;		TrueType font size,單位為點(dot)。
 | ||
| 					FSize = (dpi * point) / 72.
 | ||
| 		int	FHeight;	字型高度,單位為點(dot)。
 | ||
| 					FHeight = (dpi * point) / 72.
 | ||
| 		int	FWidth;		字型寬度,單位為點(dot)。
 | ||
| 					FWidth = (dpi * point) / 72.
 | ||
| 		LPCTSTR	FType;		TrueType font 字型名稱。
 | ||
| 		int	Fspin;		TrueType font 字體旋轉。
 | ||
| 					1 -> 0, 2 -> 90, 3 -> 180, 4 -> 270
 | ||
| 		int	FWeight;	TrueType font 字體粗細。
 | ||
| 					0 and NULL and 400 -> 400 標準、
 | ||
| 					100 -> 非常細、200 -> 極細、
 | ||
| 					300 -> 細    、500 -> 中等、
 | ||
| 					600 -> 半粗  、700 -> 粗  、
 | ||
| 					800 -> 特粗  、900 -> 黑體。
 | ||
| 		int	FItalic;	TrueType font 字體斜體。
 | ||
| 					0 -> FALSE、1 -> TRUE。
 | ||
| 		int	FUnline;	TrueType font 字體加底線。
 | ||
| 					0 -> FALSE、1 -> TRUE。
 | ||
| 		int	FStrikeOut;	TrueType font 字體加刪除線。
 | ||
| 					0 -> FALSE、1 -> TRUE。
 | ||
| 		LPCTSTR	id_name;	給予一個識別名稱存放於印表機內,以後直
 | ||
| 					接使用 Z_Load_Graphic() 即可將舊圖呼叫出來。
 | ||
| 		LPCTSTR	data;		文字內容。
 | ||
| 		int	mem		圖形儲存位置 0 -> RAM	1 -> Flash Memory
 | ||
|         
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Prn_Text_TrueType(30,35,40,"標楷體",4,400,0,0,0,"AA","機要絕密",0);
 | ||
| 		Z_Prn_Text_TrueType_W(30,35,40,30,"標楷體",4,400,0,0,0,"AA","機要絕密",0);
 | ||
| 
 | ||
| 	說明:	這個 Z_Prn_Text_TrueType 函數可以印出一行 True Type Font 文字,
 | ||
| 		但須先安裝 Window's Driver for Dr.200 or Dr.300,濃淡從 driver 設定,
 | ||
| 		印表機抓取為預設印表機,假若default printer 不是 Dr.200 或 Dr.300 ,
 | ||
| 		程式自動搜尋 Windows 內,是否有裝 Dr.200 或 Dr.300,再依序使用。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Clear_Memory()
 | ||
| ===============================================================================
 | ||
| 	功能:	清除 Printer 內 RAM 及 Flash Memory 的資料。
 | ||
| 
 | ||
| 	語法:	void Z_Clear_Memory(void);
 | ||
| 
 | ||
| 	範例:	Z_Clear_Memory();
 | ||
| 
 | ||
| 	說明:	這個 Z_Clear_Memory 函數清除 Printer 內 RAM 及 Flash Memory 的圖形
 | ||
| 		、軟體字形。因為圖形、字形會一直累積在 memory 造成 overflow,正常
 | ||
| 		時函數須在 Print_Out() 之前送出。而當 memory 充滿指令,Printer 就
 | ||
| 		會刪除先前載入的圖形和字形,為避免發生不當的刪除,須先在
 | ||
| 		Z_Print_Out() 之前送出。
 | ||
| 
 | ||
| ******************************************************************************
 | ||
| 	Z_Set_Backfeed()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定標籤回收距離。
 | ||
| 
 | ||
| 	語法:	void Z_Set_Backfeed(int nPixel);
 | ||
| 
 | ||
| 	參數:	int	nPixel;		設定標籤回收的距離,範圍:0~999。
 | ||
| 					單位 : dot
 | ||
| 
 | ||
| 	範例:	Z_Set_Backfeed(204);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Backfeed 函數可以使印表機列印完後,多吐一小段標籤紙
 | ||
| 
 | ||
| ******************************************************************************
 | ||
| 	Z_Set_Darkness()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定熱感頭列印熱度。
 | ||
| 
 | ||
| 	語法:	int Z_Set_Darkness(int darkness);
 | ||
| 
 | ||
| 	參數:	int	darkness;	設定熱感頭列印熱度,範圍:-30~30。
 | ||
| 					printer 內定為0
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_Darkness(12);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Darkness 函數控制影像濃淡,想得到更好的印出品質,你應該
 | ||
| 		考慮一些因素,像 paper media、ribbon types(wax,semi-resin 和
 | ||
| 		resin)和image pattern itself。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_DebugDialog()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定除錯環境。
 | ||
| 
 | ||
| 	語法:	int Z_Set_DebugDialog(int nEnable);
 | ||
| 
 | ||
| 	參數:	int	nEnable;	# 1 -> 除錯環境致能
 | ||
| 					  0 -> 除錯環境關閉
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_DebugDialog(1);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_DebugDialog 函數,設定除錯環境,除了會回傳錯誤碼,也會秀
 | ||
| 		出警示訊息對話框。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Label()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定連續紙張長度
 | ||
| 
 | ||
| 	語法:	int Z_Set_Label(int Length);
 | ||
| 
 | ||
| 	參數:	int	Length;		連續紙張列印長度 1 dot = 0.125 mm
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_Label(300);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Label 函數設定連續標籤長度
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Mode()
 | ||
| ===============================================================================
 | ||
| 	功能:	啟動 Cutter 或 Peel
 | ||
| 
 | ||
| 	語法:	int Z_Set_Mode(char mode);
 | ||
| 
 | ||
| 	參數:	char	mode;		T:Tear Off
 | ||
| 					P:Peel Off
 | ||
| 					C:Cutter
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_Mode('C');
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Mode 函數為重要配置
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Origin()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定 Y 座標開始列印位置
 | ||
| 
 | ||
| 	語法:	int Z_Set_Origin(int y);
 | ||
| 
 | ||
| 	參數:	int	y;	Y 座標?始列印位置
 | ||
| 				y > 0.(1 dot = 0.125 mm)
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_Origin(10);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Origin 函數在設定 Y 座標?始列印位置
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Paper()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定紙張為連續或不連續紙張
 | ||
| 
 | ||
| 	語法:	int Z_Set_Paper(char p);
 | ||
| 
 | ||
| 	參數:	char	p;	N:連續紙張
 | ||
| 				Y:不連續紙張
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_Paper('Y');
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Paper 函數在設定紙張為連續或不連續紙張
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Prncomport()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定 Serial Port。
 | ||
| 
 | ||
| 	語法:	int Z_Set_Prncomport(int baud,int parity,int data,int stop);
 | ||
| 
 | ||
| 	參數:	int	baud;		鮑爾率,如下表:
 | ||
|                                         ╒═══╤══════╕
 | ||
|                                         │ baud │   speed    │
 | ||
|                                         ╞═══╪══════╡
 | ||
|                                         │38400 │ 38,400 baud│
 | ||
|                                         ├───┼──────┤
 | ||
|                                         │19200 │ 19,200 baud│
 | ||
|                                         ├───┼──────┤
 | ||
|                                         │ 9600 │  9,600 baud│
 | ||
|                                         ├───┼──────┤
 | ||
|                                         │ 4800 │  4,800 baud│
 | ||
|                                         ├───┼──────┤
 | ||
|                                         │ 2400 │  2,400 baud│
 | ||
|                                         └───┴──────┘
 | ||
| 		int	parity;		Parity。0:none parity
 | ||
| 						1:even parity
 | ||
| 						2:odd parity
 | ||
| 		int	data;		Data bit number,7 或 8。
 | ||
| 		int	stop;		Stop bit number,1 或 2。
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	int  baud,data,stop;
 | ||
| 		char parity;
 | ||
| 		parity='N';baud=96;data=8;stop=1;
 | ||
| 		Z_Set_Prncomport(baud,parity,data,stop);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Prncomport 函數設定 Serial Port,改變 printer 與主機相同
 | ||
| 		。印表機必須與主機相同否則會發生不可預知之事情。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Prncomport_PC()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定 PC 序列埠。
 | ||
| 
 | ||
| 	語法:	int Z_Set_Prncomport_PC(int nBaudRate, int nByteSize, int nParity,
 | ||
| 				int nStopBits, int nDsr, int nCts, int nXonXoff);
 | ||
| 
 | ||
| 	參數:	int	nBaudRate;	鮑爾率,如下表:
 | ||
| 					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
 | ||
| 
 | ||
| 		int	nByteSize;	Data bit number:
 | ||
| 					0 -> 7-bit data
 | ||
| 					7 -> 7-bit data
 | ||
| 					8 -> 8-bit data
 | ||
| 
 | ||
| 		int	nParity;	Parity,如下表:
 | ||
| 					0 -> none parity
 | ||
| 					1 -> even parity
 | ||
| 					2 -> odd  parity
 | ||
| 		int	nStopBits;	Stop bit number:
 | ||
| 					0 -> 1 stop bit
 | ||
| 					1 -> 1 stop bit
 | ||
| 					2 -> 2 stop bits
 | ||
| 		int	nDsr;		Setup hardware flow control
 | ||
| 					1 -> DTR CONTROL HANDSHAKE;
 | ||
| 					0 -> DTR CONTROL ENABLE;
 | ||
| 
 | ||
| 		int	nCts;		Setup hardware flow control
 | ||
| 					1 -> RTS CONTROL HANDSHAKE;
 | ||
| 					0 -> RTS CONTROL ENABLE;
 | ||
| 
 | ||
| 		int	nXonXoff;	Setup software flow control
 | ||
| 					0 -> Enable;
 | ||
| 					1 -> Disable;
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_Prncomport_PC(0, 0, 0, 0, 1, 1, 1);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Prncomport_PC 函數會設定 PC 序列埠設定值,來改變 PC 相同
 | ||
| 		於印表機序列埠設定值,如果不同則無法與印表機連接。此函數必須在函數
 | ||
| 		Z_Print_Out 之前執行。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Reset()
 | ||
| ===============================================================================
 | ||
| 	功能:	回復到原工廠設定值
 | ||
| 
 | ||
| 	語法:	void Z_Set_Reset();
 | ||
| 
 | ||
| 	範例:	Z_Set_Reset();
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Reset 函數使用後, printer 會回復到原工廠預設值
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Speed()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定 printer 列印時的速度
 | ||
| 
 | ||
| 	語法:	int Z_Set_Speed(int s);
 | ||
| 
 | ||
| 	參數:	int	s;	1 ~ 6
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_Speed(3);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Speed 函數在設定列印時的速度
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_TPH()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定 printer 的轉印模式
 | ||
| 
 | ||
| 	語法:	int Z_Set_TPH(char m);
 | ||
| 
 | ||
| 	參數:	char	m;	T: 熱轉
 | ||
| 				D: 熱感
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_TPH('T');
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_TPH 函數為重要配置
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Unit()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定度量單位為英吋或公尺或像素
 | ||
| 
 | ||
| 	語法:	int Z_Set_Unit(char m);
 | ||
| 
 | ||
| 	參數:	char	m;	D: dots
 | ||
| 				I: inches
 | ||
| 				M: milimeters
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_Unit('D');
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Unit 函數可更改度量單位為英吋或公尺或像素
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_Gap()
 | ||
| ===============================================================================
 | ||
| 	功能:	設定 Gap 長度
 | ||
| 
 | ||
| 	語法:	int Z_Set_Gap(int nPattern, int gapLen);
 | ||
| 
 | ||
| 	參數:	int	nPattern;	0 ~ 65535
 | ||
| 		int	gapLen;		5 ~ 65535.單位: mm
 | ||
| 
 | ||
| 	傳回值: 0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Set_Gap(30,20);
 | ||
| 
 | ||
| 	說明:	這個 Z_Set_Gap 函數可設定紙張 Gap 長度,當 Gap > 5 mm 時
 | ||
| 		才使用此函數,且必須在 Z_Set_Label() 前執行
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_ProcessDlg()
 | ||
| ===============================================================================
 | ||
|       功能:  開啟或關閉進度對話框。
 | ||
| 
 | ||
|       語法:  int Z_Set_ProcessDlg(int nShow);
 | ||
| 
 | ||
|       參數:  int   nShow;		0:關閉進度對話框。
 | ||
| 					1:開啟進度對話框
 | ||
| 
 | ||
|     傳回值:  0    -> OK.
 | ||
|               Reference ZW-Error.txt file.
 | ||
| 
 | ||
|       範例:  Z_Set_ProcessDlg(1);
 | ||
| 
 | ||
|      說明:  這個 Z_Set_ProcessDlg 函數可開關進度對話框。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Bar2d_QRCode
 | ||
| ===============================================================================
 | ||
| 	功能:	2D Barcod 列印。
 | ||
| 	
 | ||
| 	語法:	int Z_Bar2d_QRCode(int x,int y,int nModel,int nMagni,
 | ||
| 			int nErr_Cor,int nInput,LPCTSTR data,int increase);
 | ||
| 
 | ||
| 	參數:	int x		:X座標
 | ||
| 		int y		:Y座標
 | ||
| 		int nModel	:QR code種類
 | ||
| 		int nMagni	:Magnification Factor
 | ||
| 				 1 --> on 150 dpi printers
 | ||
| 				 2 --> on 200 dpi printers
 | ||
| 				 3 --> on 300 dpi printers
 | ||
| 				 4 --> through 10
 | ||
| 		int nErr_Cor	:錯誤校正
 | ||
| 				 1 --> Ultra Hight Reliability
 | ||
| 				 2 --> Hight Reliability
 | ||
| 				 3 --> Standard
 | ||
| 				 4 --> Hight density
 | ||
| 		int nInput	: 1 --> Automatic
 | ||
| 				  2 --> Manual
 | ||
| 		LPCSTSTR data	:條碼資料
 | ||
| 		int increase	:增量值
 | ||
| 
 | ||
| 	傳回值:	0    -> OK.
 | ||
| 			Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	int Z_Bar2d_QRCode(20,20,2,2,3,1,"QR Code",0);
 | ||
| 
 | ||
| 	說明:  這個 Z_Bar2d_QRCode 函數可列印 2D Barcod QR Code。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Set_PrintWidth
 | ||
| ===============================================================================
 | ||
| 	功能:	設定列印範圍。
 | ||
| 	
 | ||
| 	語法:	int Z_Set_PrintWidth(int nDotWidth);
 | ||
| 
 | ||
| 	參數:	int nDotWidth	:最大列印範圍
 | ||
| 
 | ||
| 	傳回值:	0    -> OK.
 | ||
| 			Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	int Z_Set_PrintWidth(200);
 | ||
| 
 | ||
| 	說明:  這個 Z_Set_PrintWidth 函數可設定列印範圍。
 | ||
| 
 | ||
| *******************************************************************************
 | ||
| 	Z_Print_OutQuality()
 | ||
| ===============================================================================
 | ||
| 	功能:	列印所有資料。
 | ||
| 
 | ||
| 	語法:	int Z_Print_OutQuality(int nTotal, int copies, int sets, int nPause);
 | ||
| 
 | ||
| 	參數:	int	nTotal;		列印總數
 | ||
| 		int	sets;		要列印的幾組
 | ||
| 		int	copies;		資料列印份數
 | ||
| 		int	nPause;		是否要每copies張數都要暫停 1 --> Yes, 0 --> No
 | ||
| 
 | ||
| 	傳回值:	0 -> OK.
 | ||
| 		Reference ZW-Error.txt file.
 | ||
| 
 | ||
| 	範例:	Z_Print_OutQuality(1,1,1,1);
 | ||
| 
 | ||
| 	說明:	這個 Z_Print_OutQuality 函數會送所有資料到 Printer,這個函數須在所有函數之
 | ||
| 		後,Z_ClosePrn() 之前執行。
 | ||
| ******************************************************************************* |