Printing Agrox Cp-2140打印机PPLB命令

Printing Agrox Cp-2140打印机PPLB命令,printing,Printing,我正在VFP中使用Agrox CP-2140打印机 我想使用打印机直接命令,使用dll文件,我上面的打印标签正确,但打印标签之前,它的生活第一标签空白 如果我连续打印3个标签,则在每个标签之前打印其活动空白标签 请检查我上面的代码我缺少什么 CREATE CURSOR pmkbarcode ( cBarCode c(10),nRs n(6,2)) INSERT INTO pmkBarCode (cBarCode,nRs) values("123456789",450.20) INSERT IN

我正在VFP中使用Agrox CP-2140打印机 我想使用打印机直接命令,使用dll文件,我上面的打印标签正确,但打印标签之前,它的生活第一标签空白

如果我连续打印3个标签,则在每个标签之前打印其活动空白标签

请检查我上面的代码我缺少什么

CREATE CURSOR pmkbarcode ( cBarCode c(10),nRs n(6,2))
INSERT INTO pmkBarCode (cBarCode,nRs)  values("123456789",450.20)
INSERT INTO pmkBarCode (cBarCode,nRs) values("789123844",25.30)
INSERT INTO pmkBarCode (cBarCode,nRs) values("859234567",10.55)

#DEFINE vpCrLf CHR(13)+CHR(10)

DECLARE  string B_Get_DLL_Version in WINPPLB.DLL integer nShowMessage
DECLARE integer B_GetUSBDeviceInfo in WINPPLB.DLL integer nPort, string @pDeviceName, ;
        integer @pDeviceNameLen, string @pDevicePath, integer @pDevicePathLen
DECLARE integer B_CreatePrn in WINPPLB.DLL integer selection, string filename
DECLARE integer B_CreateUSBPort in WINPPLB.DLL integer nPort

DECLARE integer B_GetUSBBufferLen in WINPPLB.DLL
DECLARE integer B_EnumUSB in WINPPLB.DLL string @buf
DECLARE integer B_Set_Originpoint in WINPPLB.DLL integer hor, integer ver
DECLARE integer B_Select_Option in WINPPLB.DLL integer option
DECLARE integer B_Set_Darkness in WINPPLB.DLL integer darkness
DECLARE integer B_Set_Labgap in WINPPLB.DLL integer lablength, integer gaplength
DECLARE integer B_Set_Labwidth in WINPPLB.DLL integer labwidth
DECLARE integer B_Prn_Barcode in WINPPLB.DLL integer x, integer y, integer ori, string type_Renamed, ;
        integer narrow, integer width_Renamed, integer height_Renamed, short human, ;
        string data_Renamed
DECLARE integer B_Prn_Text in WINPPLB.DLL integer x, integer y, integer ori, integer font_Renamed, ;
        integer hor_factor, integer ver_factor, short mode, string data_Renamed
DECLARE integer B_Print_Out in WINPPLB.DLL integer labset
DECLARE B_ClosePrn in WINPPLB.DLL
Declare B_Prn_Configuration IN "WINPPLB.DLL"
DECLARE integer B_Set_Backfeed in WINPPLB.DLL short option
DECLARE integer B_Get_Pcx in "WINPPLB.DLL" integer, integer, string
DECLARE integer B_CreatePrn in "WINPPLB.DLL" integer, string

&& get total usb port to find out printer installed or not
&& and finding printer for print

&& open port.
PRIVATE nLen, ret, sw
PRIVATE pbuf, ver, strmsg
pbuf = Space(128)

&& dll version.
ver = B_Get_DLL_Version(0)

&& search port.
nLen = B_GetUSBBufferLen() + 1

strmsg = "DLL " + ver + vpCrLf   && only sample coding, not smart.
If nLen > 1
    PRIVATE buf1, buf2
    PRIVATE len1, len2
    len1 = 128
    len2 = 128
    buf1 = Space(len1)
    buf2 = Space(len2)
    B_EnumUSB(@pbuf)
    B_GetUSBDeviceInfo(1, @buf1, @len1, @buf2, @len2)
    sw = 1
    If 1 == sw
       ret = B_CreatePrn(12, buf2)   && open usb.
    Else
       ret = B_CreateUSBPort(1)   && must call B_GetUSBBufferLen() function fisrt.
    EndIf    
    If 0 < ret
        strmsg = strmsg + "Open USB fail!"
    Else
        strmsg = strmsg + "Open USB:" + vpCrLf + "Device name: "
        strmsg = strmsg + Left(buf1, len1)
        strmsg = strmsg + vpCrLf + "Device path: "
        strmsg = strmsg + Left(buf2, len2)
        && sw = 2
        If 2 == sw
          && Immediate Error Report.
          pbuf = "^ee\r\n"
          B_WriteData(1, pbuf, 5)   && ^ee
          ret = B_ReadData(@pbuf, 4, 1000)
        EndIf
    EndIf
ELSE
    MessageBox("Printer Not Ready",0,"by Prasanna")
    CreateDirectory(szSavePath, null)
    ret = B_CreatePrn(0, szSaveFile)   && open file.
    strmsg = strmsg + "Open " + szSaveFile
    If 0 < ret
        strmsg = strmsg + " file fail!"
    Else
        strmsg = strmsg + " file succeed!"
    EndIf
EndIf
MessageBox(strmsg,0,"by Prasanna")
If 0 < ret
    Return
ENDIF

?B_Set_Originpoint(0, 0) && Horizontal margin, Vertical margin measured in dots.
?B_Select_Option(2) && direct thermal, disable Cutter and Peel.
?B_Set_Darkness(8) && Setup the "darkness" function (heating level).
                  && Acceptable values from 0 to 15.The default darkness value is 8.
B_Set_Backfeed(ASC('F')) && Tear off so user can see last printed label       

    B_Set_Labgap(0117,025) && - perfect size don't change
    B_Set_Labwidth(1250) &&- perfect size don't change

SELECT pmkBarCode 
GOTO TOP 
DO WHILE !EOF()
&&E80,1

    B_Prn_Barcode(280, 120, 0,"1",2, 2, 75, 66,cBarCode)
    B_Prn_Text   (280, 230, 0, 2, 1, 1, ASC("N"), "1st Beauty Friend")
    B_Prn_Text   (520, 247,  3, 1, 2, 1, ASC("N"), "MRP."+alltrim(str(nRs,10,2)))
    B_Print_Out(1)   && copy 2.

    SELECT pmkBarCode 
    SKIP 
ENDDO 


B_ClosePrn()
创建光标pmkbarcode(cBarCode c(10),nRs n(6,2))
插入pmkBarCode(cBarCode,nRs)值(“123456789”,450.20)
插入pmkBarCode(cBarCode,nRs)值(“789123844”,25.30)
插入pmkBarCode(cBarCode,nRs)值(“859234567”,10.55)
#定义vpCrLf CHR(13)+CHR(10)
在WINPPLB.DLL整数消息中声明字符串B_Get_DLL_Version
在WINPPLB.DLL integer nPort中声明整数B_GetUSBDeviceInfo,string@pDeviceName;
整数@pDeviceNameLen,字符串@pDevicePath,整数@pDevicePathLen
在WINPPLB.DLL整数选择中声明整数B_CreatePrn,字符串文件名
在WINPPLB.DLL integer nPort中声明整数B_CreateUSBPort
在WINPPLB.DLL中声明整数B_GetUSBBufferLen
在WINPPLB.DLL字符串@buf中声明整数B_EnumUSB
在WINPPLB.DLL integer hor、integer ver中声明整数B_Set_Originpoint
在WINPPLB.DLL整数选项中声明整数B_选择_选项
在WINPPLB.DLL integer Darkness中声明整数B_Set_Darkness
在WINPPLB.DLL中声明整数B_Set_Labgap integer lablength,integer gaplength
在WINPPLB.DLL integer Labwidth中声明整数B_Set_Labwidth
在WINPPLB.DLL中声明整数B_Prn_条码整数x,整数y,整数ori,字符串类型_重命名;
整数窄,整数宽_重命名,整数高_重命名,短人;
字符串数据\u重命名
在WINPPLB.DLL中声明整型B_Prn_文本整型x,整型y,整型ori,整型字体_重命名;
整数水平因子、整数垂直因子、短模式、字符串数据
在WINPPLB.DLL integer labset中声明整数B_打印输出
在WINPPLB.DLL中声明B_ClosePrn
在“WINPPLB.DLL”中声明B_Prn_配置
在WINPPLB.DLL short选项中声明整数B_Set_Backfeed
在“WINPPLB.DLL”中声明整数B_Get_Pcx整数,整数,字符串
在“WINPPLB.DLL”整数、字符串中声明整数B_CreatePrn
&&获取总usb端口以确定打印机是否已安装
&&以及寻找打印机进行打印
&&开放端口。
私人nLen、ret、sw
私人pbuf、ver、strmsg
pbuf=空间(128)
&&dll版本。
ver=B_获取_DLL_版本(0)
&&搜索端口。
nLen=B_GetUSBBufferLen()+1
strmsg=“DLL”+ver+vpCrLf&&仅示例编码,不智能。
如果nLen>1
二等兵
二等兵,二等兵
len1=128
len2=128
buf1=空间(len1)
buf2=空间(len2)
B_EnumUSB(@pbuf)
B_GetUSBDeviceInfo(1,@buf1,@len1,@buf2,@len2)
sw=1
如果1==sw
ret=B_CreatePrn(12,buf2)和打开usb。
其他的
ret=B_CreateUSBPort(1)&必须首先调用B_GetUSBBufferLen()函数。
恩迪夫
如果0