alex d030bbabe2 Patch level : 4.0 667
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
2006-12-13 16:22:33 +00:00

1087 lines
88 KiB
Plaintext
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

 ~g2fk;
/******************************************************************************
Module: BWIN-CAPI.TXT
All commands for PPLB in Dynamic Link Library for Windows
Notices: Copyright (c) 1998-2006 ARGOIMPREX
Version: 3.04BW 2006/02/15
******************************************************************************/
目錄
===============================================================================
B_Bar2d_Maxi() => 印出一個 Maxi Code 2D Barcode。
B_Bar2d_PDF417() => 印出一個 PDF-417 2D Barcode。
B_Bar2d_PDF417_N() => 印出一個 PDF-417 2D Barcode。
B_ClosePrn() => 關閉 Printer 工作。
B_CreatePrn() => 開啟 Printer 工作。
B_Del_Form() => 刪除 Form (表格)。
B_Del_Pcx() => 刪除 Form (表格)。
B_Draw_Box() => 畫一個框。
B_Draw_Line() => 畫一條線。
B_Error_Reporting() => 開啟或關閉錯誤回傳功能。
B_Get_DLL_Version() => 取得或秀出此函數庫版本資訊。
B_Get_DLL_VersionA() => 取得或秀出此函數庫版本資訊。
B_Get_Graphic_ColorBMP() => 轉換 BMP 圖檔彩色變灰階,並將圖形儲存在印表機內的 RAM。
B_Get_Pcx() => 列印一個圖形並將圖形儲存在印表機內的 Memory。
B_Initial_Setting() => 前置處理。
B_Load_Pcx() => 列印一個圖形。
B_Open_ChineseFont() => 開啟使用中文點矩陣字型檔案 (16*15 和 24*24)。
B_Print_Form() => 列印一個 FORM (表格),並輸入 FORM 所有變數、計數資料。
B_Print_MCopy() => 列印所有資料和加上跳號複製功能。
B_Print_Out() => 列印所有資料。
B_Prn_Barcode() => 印出一個條碼和加上跳號功能。
B_Prn_Configuration() => 列印印表機內部配置。
B_Prn_Text() => 印出一行文字和加上跳號功能。
B_Prn_Text_Chinese() => 印出一行文字,使用中文點矩陣字型檔案 (16*15 或 24*24)。
B_Prn_Text_TrueType() => 印出一行 True Type Font 文字。
B_Prn_Text_TrueType_W() => 印出一行 True Type Font 文字,並控制字型的寬及高。
B_Select_Option() => 設定轉印模式、啟動 Cutter 或 Peel。
B_Select_Option2() => 設定轉印模式、啟動 Cutter 或 Peel。
B_Select_Symbol() => 符號設定選擇。
B_Set_Backfeed() => 啟動 Back feed。
B_Set_BMPSave() => 儲存影像圖檔。
B_Set_Darkness() => 設定熱感頭列印熱度。
B_Set_DebugDialog() => 設定除錯環境。
B_Set_Direction() => 設定列印方向。
B_Set_Form() => 儲存並列印 FORM (表格)。
B_Set_Labgap() => 同時設定標籤長度及 GAP 長度。
B_Set_Labwidth() => 設定標籤寬度。
B_Set_Originpoint() => 設定開始列印點。
B_Set_Prncomport() => 設定 Serial Port。
B_Set_Prncomport_PC() => 設定 PC 序列埠。
B_Set_Speed() => 設定列印速度。
B_Set_ProcessDlg() => 開啟或關閉進度對話框
B_GetUSBBufferLen() => 查詢 USB 埠資料長度
B_EnumUSB() => 取得 USB 埠的資料
B_CreateUSBPort() => 使用 USB 埠進行傳輸
B_ResetPrinter() => 使印表機重新開機
*******************************************************************************
注意事項
===============================================================================
使用方法1.將 WINPPLB.DLL 加入 \\Windows\system\ 或 \\???\ 執行中路徑,
才能被搜尋到。
2.以下範例為 Visual C++ 的範例,其他程式語言不一定完全相同
*******************************************************************************
B_GetUSBBufferLen()
B_EnumUSB()
===============================================================================
功能: 取得 USB Printer 的資料。
語法: int B_GetUSBBufferLen();
int B_EnumUSB(char *buf);
參數: char *buf; ●儲存 USB Printer 資料。
傳回值: B_GetUSBBufferLen(); 傳回 USB 的資料長度
B_EnumUSB() 0 -> OK.
Reference AW-Error.txt file.
範例: char *buf;
int nLen = B_GetUSBBufferLen()+1;
buf = malloc(nLen);
memset(buf, 0, nLen);
B_EnumUSB(buf);
說明: 這兩個函數是一組的函數。先用 B_GetUSBBufferLen() 取得 USB 傳輸埠的資料
長度, 然後再配記憶體給 B_EnumUSB() 儲存 USB 埠的資料。USB 埠的資料是以
("0x0d0x0a")做分隔,舉例來說, 如果資料是 A-200(0x0d)(0x0a)R-400ZIP 的話
表示 USB1 是接 A-200, USB2 是接 R-400Zip。
*******************************************************************************
B_CreatePrn()
B_CreateUSBPort()
===============================================================================
功能: 開啟 Printer 工作。
語法: int B_CreatePrn(int selection,LPCTSTR filename);
int B_CreateUSBPort(int nPort);
參數: int selection; ●擇輸出埠或檔案。
0 -> print to file.
1 -> lpt1, 2 -> lpt2, 3 -> lpt3
4 -> com1, 5 -> com2, 6 -> com3
LPCTSTR filename; ●當 selection 內容是 0 時資料則輸出至檔
案,檔名就是 filename 內容,可含路徑,或
是 NULL。當 selection 內容是 10 時,
filename 為輸出路徑。
int nPort; ● USB 傳輸埠
傳回值0 -> OK.
Reference BW-Error.txt file.
範例: B_CreatePrn(1,NULL); 或 B_CreatePrn(0,"C:\TEMP\out.prn");
B_CreatePrn(10,"\\allen\Label"); 或 B_CreateUSBPort(1);
說明: B_CreatePrn 和 B_CreateUSBPort 函數會開啟你選擇的輸出埠或開啟你鍵入的
輸出檔。而這個函數必須在所有函數之前執行。
B_CreatePrn 和 B_CreateUSBPort 不能同時使用。
*******************************************************************************
B_ClosePrn()
===============================================================================
功能: 關閉 Printer 工作。
語法: void B_ClosePrn(void);
範例: B_ClosePrn();
 說明: 這個 B_ClosePrn 函數會關閉執行過的記憶體及你選擇的輸出埠或關閉你開啟的
輸出檔。而這個函數必須在所有函數之後執行。
*******************************************************************************
B_Bar2d_Maxi()
===============================================================================
功能: 印出一個 Maxi Code 2D Barcode。
語法: int B_Bar2d_Maxi(int x,int y,int cl,int cc,long int pc,LPCTSTR data);
參數: int x; ●X 座標。
int y; ●Y 座標。備註1 dot = 0.125 mm。
int cl; ●A 3-位數 Class code。
int cc; ●A 3-位數 Country code。
long int pc; ●在美國 Post code 是一個4或5-位數,
其他國家是 6 位數。
LPCTSTR data; ●資料字串最多84個字元。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int x,y,cl,cc;
long int pc;
LPCTSTR data="This MaxiCode";
x=50;y=50;cl=300;cc=400;pc=93065;
B_Bar2d_Maxi(x,y,cl,cc,pc,data);
 說明: 這個 B_Bar2d_Maxi 函數可以列印出一個 Maxi Code 2D Barcode。
*******************************************************************************
B_Bar2d_PDF417()
===============================================================================
功能: 印出一個 PDF-417 2D Barcode。
語法: int B_Bar2d_PDF417(int x,int y,int w,int v,int s,int c,int px,
int py,int r,int l,int t,int o,LPCTSTR data);
參數: int x; ●X 座標。
int y; ●Y 座標。備註1 dot = 0.125 mm。
int w; ●最大列印寬度,單位 dots。
int v; ●最大列印高度,單位 dots。
int s; ●錯誤校正等級範圍08。
int c; ●資料壓縮等級範圍0 或 1。
int px; ●模組寬度範圍29 dots。
int py; ●模組高度範圍499 dots。
int r; ●最大 row count。
int l; ●最大 column count。
int t; ●Truncation flag
'0' 是 normal 和 '1' 是 truncated.
int o; ●列印方向定位,'0'是 0°'1'是90°、
'2'是180°'3'是270°
LPCTSTR data; ●資料字串。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int x,y,w,v,s,c,px,py,r,l,t,o;
LPCTSTR data="ARGOXINFO";
x=10;y=10;w=400;v=300;s=0;c=0;px=3;py=7;r=10;l=2;t=0;o=0;
B_Bar2d_PDF417(x,y,w,v,s,c,px,py,r,l,t,o,data);
 說明: 這個 B_Bar2d_PDF417 函數可以列印出一個 PDF-417 2D Barcode。
*******************************************************************************
B_Del_Form()
===============================================================================
功能: 刪除 Form (表格)。
語法: int B_Del_Form(char formname[10]);
參數: char formname[10]; ●表格名稱,最多 9 個字。
當 formname 內容是 '*'時將會清除印表
機內所有表格。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: char formname[10] = "demo";
B_Del_Form(formname);
 說明: 這個 B_Del_Form 函數會刪除印表機內,你輸入的 Form (表格)名稱。當
你刪除它後,將不能再還原,但可以重新載入。
*******************************************************************************
B_Del_Pcx()
===============================================================================
功能: 刪除圖形。
語法: int B_Del_Pcx(char pcxname[10]);
參數: char pcxname[10]; ●圖形名稱,最多 9 個字。
當 pcxname 內容是 '*'時將會清除印表
機內 RAM 或 flash memory 所有圖形。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: char pcxname[10]="*";
B_Del_Pcx(pcxname);
 說明: 這個 B_Del_Pcx 函數會刪除印表機內,你輸入的圖形名稱。當你刪除它後,
將不能再還原,但可以重新載入。
*******************************************************************************
B_Draw_Box()
===============================================================================
功能: 畫一個框。
語法: int B_Draw_Box(int x,int y,int thickness,int hor_dots,int ver_dots);
參數: int x; ●起點 X 座標。
int y; ●起點 Y 座標。
備註1 dot = 0.125 mm。
int thickness; ●指定框四邊邊線厚度。
int hor_dots; ●對角點 X 座標。
int ver_dots; ●對角點 Y 座標。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int x,y,thickness,hor_dots,ver_dots;
x=50;y=120;thickness=5;hor_dots=250;ver_dots=150;
B_Draw_Box(x,y,thickness,hor_dots,ver_dots);
 說明: 這個 B_Draw_Box 函數會畫一個屬性是 "OR" 的框。
*******************************************************************************
B_Draw_Line()
===============================================================================
功能: 畫一條線。
語法: int B_Get_Line(char mode,int x,int y,int hor_dots,int ver_dots);
參數: char mode; ●選擇線條種類,如下表:
╒══╤═══════════╕
│mode│線條種類 │
╞══╪═══════════╡
│ E │exclusive OR │
├──┼───────────┤
│ O │OR │
├──┼───────────┤
│ W │白線,它會蓋掉先前影像│
└──┴───────────┘
int x; ●起點 X 座標。
int y; ●起點 Y 座標。
備註1 dot = 0.125 mm。
int width; ●水平長度。
int height; ●垂直長度。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: char mode,
int x,y,hor_dots,ver_dots;
mode='O';x=50;y=30;hor_dots=100;ver_dots=10;
B_Draw_Line(mode,x,y,hor_dots,ver_dots);
 說明: 這個 Draw_Line 函數會畫一個屬性是"OR"或"XOR"的線條及一條白線。
*******************************************************************************
B_Error_Reporting()
===============================================================================
功能: 開啟或關閉錯誤回傳功能。
語法: int B_Error_Reporting(char option);
參數: char option; ●當 option 是'N'時 Disable 狀態回饋,
'S' 是 Enable 狀態回饋。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: char option;
option='S';
B_Error_Reporting(option);
 說明: 這個 B_Error_Reporting 函數會使印表機狀態回饋 Disable/Enable這回
饋通道是透過 RS232 Port。預定值是 Disable。
*******************************************************************************
B_Get_DLL_Version()
B_Get_DLL_VersionA()
===============================================================================
功能: 取得或秀出此函數庫版本資訊。
語法: char* B_Get_DLL_Version(int nShowMessage);
int B_Get_DLL_VersionA(int nShowMessage);
參數: int nShowMessage; ●訊息視窗顯現。0 -> 不顯現、1 -> 顯現。
傳回值: 傳回版本資訊字串,失敗則傳回 NULL。
B_Get_DLL_VersionA() -> return version value.
範例: B_Get_DLL_Version(1);
 說明: 這個 B_Get_DLL_Version 函數,讓使用者取得或秀出此函數庫版本資訊。
*******************************************************************************
B_Get_Graphic_ColorBMP()
===============================================================================
功能: 轉換 BMP 圖檔彩色變灰階,並將圖形儲存在印表機內的 RAM。
語法: int B_Get_Graphic_ColorBMP(int x, int y, LPCTSTR filename);
參數: int x; ●X 座標。
int y; ●Y 座標。
LPCTSTR filename ●圖形檔名稱,可含路徑。
格式如XXXXXXXX.XXX 或 X:\XXX\XXX.BMP
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Get_Graphic_ColorBMP(30,20,"girl.bmp");
 說明: 這個 B_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,再依序使用。圖形儲存在印表機內的 RAM。
*******************************************************************************
B_Get_Pcx()
===============================================================================
功能: 列印一個圖形並將圖形儲存在印表機內的 Memory。
語法: int B_Get_Pcx(int x,int y,LPCTSTR filename);
參數: int x; ●X 座標。
int y; ●Y 座標。備註1 dot = 0.125 mm。
LPCTSTR filename; ●圖形檔名稱,可含路徑。
格式如XXXXXXXX.XXX 或 X:\XXX\XXX.PCX
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Get_Pcx(10,100,"phone.pcx");
 說明: 這個 B_Get_Pcx 函數會列印一個圖形並將圖形儲存在印表機內的 RAM 或
flash memory。圖形檔必須是 PCX 的格式。
*******************************************************************************
B_Initial_Setting()
===============================================================================
功能: 前置處理。
語法: int B_Initial_Setting(int Type,LPCTSTR Source);
參數: int Type; ●選擇輸入模式,值為 0 -> 輸入字串,
1 -> 輸入檔案。
LPCTSTR Source; ●資料來源,可為字串或檔案名稱,可含路徑。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: LPCTSTR aa = "ZT\r\n\0"; B_Initial_Setting(0,aa);
or
B_Initial_Setting(1,"initfile.txt");
 說明: 這個 B_Initial_Setting 函數前置處理的動作,是將一串 Command 先送至印表
機,由字串或檔案輸入,在使用這個函數時,須先在 B_Create_Prn() 之後其他
函數之前,可作為使用者自訂型態。
*******************************************************************************
B_Load_Pcx()
===============================================================================
功能: 列印一個圖形。
語法: int B_Load_Pcx(int x,int y,char pcxname[10]);
參數: int x; ●X 座標。
int y; ●Y 座標。備註1 dot = 0.125 mm。
char pcxname[10]; ●圖形檔名稱最大9個字元。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int x,y;
char pcxname[10]="phone";
x=50;y=30;
B_Load_Pcx(x,y,pcxname);
 說明: 這個 B_Load_Pcx 函數會列印一個 PCX 格式圖形,而圖形必須事先載入印表
機內的 RAM 或 flash memory 儲存。
*******************************************************************************
B_Open_ChineseFont()
===============================================================================
功能: 開啟使用中文點矩陣字型檔案 (16*15 和 24*24)。
語法: int B_Open_ChineseFont(char* path);
參數: char* path; ●中文點矩陣字型檔案來源路徑。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Open_ChineseFont("C:\\ET3");
 說明: 這個 B_Open_ChineseFont 函數開啟中文點矩陣字型檔案 (16*15 和 24*24)
供 B_Prn_Text_Chinese 函數使用。
*******************************************************************************
B_Print_Form()
===============================================================================
功能: 列印一個 FORM (表格),並輸入 FORM 所有變數、計數資料。
語法: int B_Print_Form(int labset,int copies,char form_out[10],
LPTSTR var);
參數: int labset; ●列印的份數範圍132767。
int copies; ●複製的份數範圍132767。
char form_out[10]; ●表格名稱,同於之前載入的 FORM 名稱,
或原先儲存在印表機內的 FORM。
LPTSTR var; ●輸入 FORM 所有變數、計數資料,用 ","
依序分別區隔開。如果變數裡有","號,
可用";,"來代表逗號。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int labset,copies;
char form_out[10]="demo";
LPTSTR var="2000,deng";
labset=3;copypiece=2;
B_Print_form(labset,copies,form_out,var);
 說明: 這個 B_Print_Form 函數會送所有資料及表格到 Printer這個函數使用前
須先執行 B_Set_Form()並在所有函數之後B_ClosePrn() 之前執行。當使
用此函數時,就不須執行 B_Print_Out()。
*******************************************************************************
B_Print_MCopy()
===============================================================================
功能: 列印所有資料和加上跳號複製功能。
語法: int B_Print_MCopy(int labset,int copies)
參數: int labset; ●列印的份數。
int copies; ●複製的份數,當為 1 時同等於Print_Out()功
能。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Print_MCopy(2,2);
說明: 這個 B_Print_MCopy 函數會送所有資料到 Printer這個函數須在所有函數之
B_ClosePrn() 之前執行,當使用此函數時,就不須執行 B_Print_Out()。它
包含 B_Print_Out() 所有功能。
*******************************************************************************
B_Print_Out()
===============================================================================
功能: 列印所有資料。
語法: int B_Print_Out(int labset);
參數: int labset; ●列印的份數。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Print_Out(1);
 說明: 這個 B_Print_Out 函數會送所有資料到 B_Printer這個函數須在所有函數之
B_ClosePrn() 之前執行。
*******************************************************************************
B_Prn_Barcode()
===============================================================================
功能: 印出一個條碼和加上跳號功能。
語法: int B_Prn_Barcode(int x,int y,int ori,char type[4],int narrow,
int width,int height, char human,LPCTSTR data);
參數: int x; ●X 座標。
int y; ●Y 座標。
備註200 dpi => 1 dot = 0.125 mm。
int ori; ●列印方向定位,'0'是 0°'1'是90°、
'2'是180°'3'是270°
char type[4]; ●Bar code 型式、如下表:
╒══╤══════════════╤══╤══════════════╕
│type│ 條碼種類 │type│ 條碼種類 │
╞══╪══════════════╪══╪══════════════╡
│ 0 │Code 128 UCC (shipping cont-│ E30│EAN-13 │
│ │ainer code) ├──┼──────────────┤
├──┼──────────────┤ E32│EAN-13 2 digit add-on │
│ 1 │Code 128 subset A,B and C ├──┼──────────────┤
├──┼──────────────┤ E35│EAN-13 5 digit add-on │
│ 1E │UCC/EAN ├──┼──────────────┤
├──┼──────────────┤ E80│EAN-8 │
│ 2 │Interleaved 2 of 5 ├──┼──────────────┤
├──┼──────────────┤ E82│EAN-8 2 digit add-on │
│ 2C │Interleaved 2 of 5 with che-├──┼──────────────┤
│ │ck sum digit │ E85│EAN-8 5 digit add-on │
├──┼──────────────┼──┼──────────────┤
│ 2D │Interleaved 2 of 5 with hum-│ K │Codabar │
│ │an readable check digit ├──┼──────────────┤
├──┼──────────────┤ P │Postnet │
│ 2G │German Postcode ├──┼──────────────┤
├──┼──────────────┤ UA0│UPC-A │
│ 2M │Matrix 2 of 5 ├──┼──────────────┤
├──┼──────────────┤ UA2│UPC-A 2 digit add-on │
│ 2U │UPC Interleaved 2 of 5 ├──┼──────────────┤
├──┼──────────────┤ UA5│UPC-A 5 digit add-on │
│ 3 │Code 3 of 9 ├──┼──────────────┤
├──┼──────────────┤ UE0│UPC-E │
│ 3C │Code 3 of 9 with check sum ├──┼──────────────┤
│ │digit │ UE2│UPC-E 2 digit add-on │
├──┼──────────────┼──┼──────────────┤
│ 9 │Code 93 │ UE5│UPC-E 5 digit add-on │
└──┴──────────────┴──┴──────────────┘
int narrow; ●NARROW bar 寬度在最小單位,
int width; ●WIDE bar 寬度在最小單位,
int height; ●Bar code 高度。
int human; ●當 human 是'N'時,則不列印文字,
當 human 是'B'時,則列印可讀文字。
LPCTSTR data; ●資料字串,當尾端資料加上
<Operation Number> 格式為加上跳號功能,
Operation: + or - 記號,
Number: 0 ~ 32768 數值。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Prn_Barcode(650,15,0,"E80",2,2,51,'B',"1234567"); 無跳號功能
or
B_Prn_Barcode(650,15,0,"E80",2,2,51,'B',"1234567<+10>"); 有跳號功能
 說明: 這個 B_Prn_Barcode 函數可以列印出一個特定 Barcode 和加上跳號功能。
*******************************************************************************
B_Prn_Configuration()
===============================================================================
功能: 列印印表機內部配置。
語法: void B_Prn_Configuration(void);
範例: B_Prn_Configuration();
 說明: 這個 B_Prn_Configuration 函數會列印印表機內部配置,包含設定、
firmware 版本、accessories、等....。
*******************************************************************************
B_Prn_Text()
===============================================================================
功能: 印出一行文字和加上跳號功能。
語法: int B_Prn_Text(int x,int y,int ori,int font,int hor_factor,
int ver_factor,char mode,LPCTSTR data);
參數: int x; ●X 座標。
int y; ●Y 座標。備註1 dot = 0.125 mm。
int ori; ●列印方向定位,'0'是 0°'1'是90°、
'2'是180°'3'是270°
int font; ●選擇字形15 選擇常佇字形。
int hor_factor; ●水平放大比例範圍124。
int ver_factor; ●垂直放大比例範圍124。
char mode; ●反白功能,'N'普通文字,
'R'反白文字。
LPCTSTR data; ●資料字串,當尾端資料加上
<Operation Number> 格式為加上跳號功能,
Operation: + or - 記號,
Number: 0 ~ 32768 數值。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Prn_Text(50,110,0,4,1,1,'N',"A123456"); 無跳號功能
or
B_Prn_Text(50,110,0,4,1,1,'N',"A123456<-1>"); 有跳號功能
 說明: 這個 B_Prn_Text 函數可以列印出一行文字和加上跳號功能。
*******************************************************************************
B_Prn_Text_Chinese()
===============================================================================
功能: 印出一行文字,使用中文點矩陣字型檔案 (16*15 或 24*24)。
語法: int B_Prn_Text_Chinese(int x,int y,int fonttype,LPCTSTR id_name,LPCTSTR data);
參數: int x; ●X 座標。(dot)
int y; ●Y 座標。(dot)
int fonttype; ●矩陣字型選擇。
0 -> 16*15、1 -> 24*24。
LPCTSTR id_name; ●給予一個識別名稱存放於印表機內,以後直
接使用 Load_Pcx() 即可將舊圖呼叫出來。
LPCTSTR data; ●文字內容。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Open_ChineseFont("C:\\ET3");
B_Prn_Text_Chinese(100, 100, 0,"A01","國家利益當前AbCcDd");
 說明: 這個 B_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,在依序使用。
*******************************************************************************
B_Prn_Text_TrueType()
B_Prn_Text_TrueType_W()
===============================================================================
功能: 印出一行 True Type Font 文字。
語法: int B_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 B_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 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; ●給予一個識別名稱存放於印表機內,以後直
接使用 Load_Pcx() 即可將舊圖呼叫出來。
LPCTSTR data; ●文字內容。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Prn_Text_TrueType(30,35,40,"標楷體",4,400,0,0,0,"AA","機要絕密");
B_Prn_Text_TrueType_W(30,35,40,30,"標楷體",4,400,0,0,0,"AA","機要絕密");
 說明: 這個 B_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,在依序使用。
*******************************************************************************
B_Select_Option()
B_Select_Option2()
===============================================================================
功能: 設定轉印模式、啟動 Cutter 或 Peel。
語法: int B_Select_Option(int object);
int B_Select_Option2(int object, int p)
參數: int object; ●印表機功能選項。
1 -> 開啟熱轉,關閉 Cutter 和 Peel。
2 -> 開啟熱感,關閉 Cutter 和 Peel。
3 -> 開啟熱感和 Cutter關閉 Peel。
4 -> 開啟熱感和 Peel關閉 Cutter。
5 -> 開啟熱轉和 Cutter關閉 Peel。
6 -> 開啟熱轉和 Peel關閉 Cutter。
int p; ●設定Cutter裁切張數,使用Cutter時才有效
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Select_Option(1);
B_Select_Option2(3, 2);
 說明: B_Select_Option, B_Select_Option2函數可以選擇不同 Printer 選項,使印
表機依據這些選項工作。
*******************************************************************************
B_Select_Symbol()
===============================================================================
功能: 符號設定選擇。
語法: int B_Select_Symbol(int num_bit,int symbol,int country);
參數: int num_bit; ●資料位元數量。8 是 8-bit data 和
7 是 7-bit data。
int symbol; ●符號設定。見下表:
備註:工廠內定符號設定是 Code page
437(English)。
int country; ●KDU country code.
╒══════════════╤══════════════╕
│ 8 bit data │ 7 bit data │
├───┬──────────┼───┬──────────┤
│symbol│ Code page │symbol│ Code page │
╞═══╪══════════╪═══╪══════════╡
│ 0 │English(437) │ 0 │USASCII │
├───┼──────────┼───┼──────────┤
│ 1 │Latin(850) │ 1 │British │
├───┼──────────┼───┼──────────┤
│ 2 │Slavic(852) │ 2 │German │
├───┼──────────┼───┼──────────┤
│ 3 │Portugal(860) │ 3 │French │
├───┼──────────┼───┼──────────┤
│ 4 │Canadian?French(863)│ 4 │Danish │
├───┼──────────┼───┼──────────┤
│ 5 │Nordic(865) │ 5 │Italian │
├───┼──────────┼───┼──────────┤
│ │ │ 6 │Spanish │
├───┼──────────┼───┼──────────┤
│ │ │ 7 │Swedish │
├───┼──────────┼───┼──────────┤
│ │ │ 8 │Swiss │
└───┴──────────┴───┴──────────┘
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int num_bit,symbol,country;
num_bit=7;symbol=5;country=1;
B_Select_Symbol(num_bit,symbol,country);
 說明: 這個 B_Select_Symbol 函數可以選擇適當符號設定。
*******************************************************************************
B_Set_Backfeed()
===============================================================================
功能: 啟動 Back feed。
語法: int B_Set_Backfeed(char option);
參數: char option; ●功能選項,"B" 關閉 Back feed。
"F" 啟動 Back feed。
它可吐出一定長度,讓使用者看到印出結
果。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: char option;
option='B';
B_Set_Backfeed(option);
 說明: 這個 B_Set_Backfeed 函數可以調整停止點。
*******************************************************************************
B_Set_BMPSave()
===============================================================================
功能: 儲存影像圖檔。
語法: int B_Set_BMPSave(int nSave, char *pstrBMPFName);
參數: int nSave; # 1 -> 儲存圖檔
0 -> 不儲存圖檔
char *pstrBMPFName; # 儲存圖檔的名稱
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Set_BMPSave(1, "C:\TempBMP.bmp");
 說明: 這個 B_Set_BMPSave 函數,可以決定是否儲存影像圖檔。
*******************************************************************************
B_Set_Darkness()
===============================================================================
功能: 設定熱感頭列印熱度。
語法: int B_Set_Darkness(int darkness);
參數: int darkness; ●設定熱感頭列印熱度範圍015
定是 8。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int darkness;
darkness=9;
B_Set_Darkness(darkness);
 說明: 這個 B_Set_Darkness 函數控制影像濃淡,想得到更好的印出品質,你應該
考慮一些因素,印出圖案樣式、速度。
*******************************************************************************
B_Set_DebugDialog()
===============================================================================
功能: 設定除錯環境。
語法: int B_Set_DebugDialog(int nEnable);
參數: int nEnable; # 1 -> 除錯環境致能
0 -> 除錯環境關閉
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Set_DebugDialog(1);
 說明: 這個 B_Set_DebugDialog 函數,設定除錯環境,除了會回傳錯誤碼,也會秀
出警示訊息對話框外。
*******************************************************************************
B_Set_Direction()
===============================================================================
功能: 設定列印方向。
語法: int B_Set_Direction(char direction);
參數: int direction; ●設定列印方向範圍B 和 T。
它們是對角對稱。內定是 T。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: char direction;
direction='T';
B_Set_Direction(direction);
 說明: 這個 B_Set_Direction 函數設定列印方向,對整個版面內所有圖形文字。
*******************************************************************************
B_Set_Form()
===============================================================================
功能: 儲存並列印 FORM (表格)。
語法: int B_Set_Form(LPCTSTR formfile);
參數: LPCTSTR formfile; ●表格檔案名稱,可含路徑。
表格檔的來源,使用 Drive Disk 內
dos\pplb\demo.bat 來設定取得。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Set_Form("demo.prn");
 說明: 這個 B_Set_Form 函數儲存並列印 FORM (表格)。在使用這個函數時,須先
在 B_Print_Form函數之前。使用此函數時就必須執行 B_Print_Form()。
*******************************************************************************
B_Set_Labgap()
===============================================================================
功能: 同時設定標籤長度及 GAP 長度。
語法: int B_Set_Labgap(int lablength,int gaplength);
參數: int lablength; ●標籤長度。單位 dot。
int gaplength; ●GAP 長度。當是連續紙時,必須設為 0。
備註1 dot = 0.125 mm。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int lablength,gaplength;
lablength=100;gaplength=20;
B_Set_Labgap(lablength,gaplength);
 說明: 這個 B_Set_Labgap 函數設定標籤長度及 GAP 長度。
*******************************************************************************
B_Set_Labwidth()
===============================================================================
功能: 設定標籤寬度。
語法: int B_Set_Labwidth(int labwidth);
參數: int labwidth; ●標籤寬度。單位 dot。
備註1 dot = 0.125 mm。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int labwidth;
labwidth=250;
B_Set_Labwidth(labwidth);
 說明: 這個 B_Set_Labwidth 函數設定標籤寬度。當使用此函數,就不能使用
B_Set_Originpoint 函數。
*******************************************************************************
B_Set_Originpoint()
===============================================================================
功能: 設定開始列印點。
語法: int B_Set_Originpoint(int hor,int ver);
參數: int hor; ●水平邊界基點。單位 dot。
int ver; ●垂直邊界基點。單位 dot。
備註1 dot = 0.125 mm。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int hor,ver;
hor=0;ver=0;
B_Set_Originpoint(hor,ver);
 說明: 這個 B_Set_Originpoint 函數使用重新設定起源點 X、Y 軸。
*******************************************************************************
B_Set_Prncomport()
===============================================================================
功能: 設定 Serial Port。
語法: int B_Set_Prncomport(int baud,char parity,int data,int stop);
參數: int baud; ●鮑爾率,如下表:
╒══╤══════╕
│baud│ speed │
╞══╪══════╡
│ 38 │ 38,400 baud│
├──┼──────┤
│ 19 │ 19,200 baud│
├──┼──────┤
│ 96 │ 9,600 baud│
├──┼──────┤
│ 48 │ 4,800 baud│
├──┼──────┤
│ 24 │ 2,400 baud│
└──┴──────┘
char parity; ●Parity。'O'是 odd'E'是 even parity
'N'是 none parity。
int data; ●Data bit number7 或 8。
int stop; ●Stop bit number1 或 2。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int baud,data,stop;
char parity;
parity='N';baud=96;data=8;stop=1;
B_Set_Prncomport(baud,parity,data,stop);
 說明: 這個 B_Set_Prncomport 函數設定 Serial Port改變 printer 與主機相同
。印表機必須與主機相同否則會發生不可預知之事情。
*******************************************************************************
B_Set_Prncomport_PC()
===============================================================================
功能: 設定 PC 序列埠。
語法: int B_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 BW-Error.txt file.
範例: B_Set_Prncomport_PC(0, 0, 0, 0, 1, 1, 1);
 說明: 這個 B_Set_Prncomport_PC 函數會設定 PC 序列埠設定值,來改變 PC 相同
於印表機序列埠設定值,如果不同則無法與印表機連接。此函數必須在函數
B_Print_Out 之前執行。
*******************************************************************************
B_Set_Speed()
===============================================================================
功能: 設定列印速度。
語法: int B_Set_Speed(int speed);
參數: int speed; ●列印速度範圍07。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: int speed;
speed=2;
B_Set_Speed(speed);
 說明: 這個 B_Set_Speed 函數設定列印速度。
*******************************************************************************
B_Set_ProcessDlg()
===============================================================================
功能: 開啟或關閉進度對話框。
語法: int B_Set_ProcessDlg(int nShow);
參數: int nShow; 0:關閉進度對話框。
1:開啟進度對話框
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Set_ProcessDlg(1);
 說明: 這個 B_Set_ProcessDlg 函數可開關進度對話框。
*******************************************************************************
B_Bar2d_PDF417_N()
===============================================================================
功能: 印出一個 PDF-417 2D Barcode。
語法: int B_Bar2d_PDF417_N(int x, int y, int w, int h, LPCTSTR pParameter, LPCTSTR data);
參數: int x; ●X 座標。
int y; ●Y 座標。
int w; ●最大列印寬度,單位 dots。
int h; ●最大列印高度,單位 dots。
LPCTSTR pParameter ●其他可隱藏之參數,此參數可以是NULL。
錯誤校正等級(s)範圍08。
資料壓縮等級(c)範圍0 或 1。
print human readable(pxxx,yyy,mm)
xxx:Human readable horizontal start location, 0 ~ 999.
yyy: Human readable vertical start location, 0 ~ 999.
mm:Maximum characters per line, 0 ~ 99.
f:Bar code origin point, 0 or 1.
模組寬度(x)範圍29 dots。
模組高度(y)範圍499 dots。
最大 row count(r)。
最大 column count(l)。
Truncation flag(t)'0' 是 normal 和 '1' 是 truncated.
LPCTSTR data; ●資料字串。
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_Bar2d_PDF417_N(10,10,400,300,”s0,c0,p400,400,10,f0,x3,y7,r10,l2,f0”,"ARGOXINFO");
pParameter參數可以任意組合
 說明: 1.這個 B_Bar2d_PDF417 函數可以列印出一個 PDF-417 2D Barcode。
2.印表機支援版本 -- R400 R2B0 3.08
*******************************************************************************
B_ResetPrinter()
==============================================================================
功能: 此函數會使印表機重新開機。
語法: int B_ResetPrinter();
傳回值: 0 -> OK.
Reference BW-Error.txt file.
範例: B_ResetPrinter();
*******************************************************************************