admin
2 天以前 6e4a6789e948bc6a8dc9fc1aa3eebc2980be3072
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.billion.main.print;
 
public class ZplPrinterTest {
    public static void main(String[] args) {
        ZplPrinter p = new ZplPrinter("Kyocera ECOSYS M4125idn KX"); //本地
        p.resetZpl();//清除
        printFawTroue(p,"1255525");
        p.resetZpl();
    }
    public static boolean printFawTroue(ZplPrinter p,String data) {
        String bar1 = data;
        // todo String bar1Zpl = "^FO250,10^BQN,2,100^FDMM,1${data}^FS";//二维码样式模板 ${data} 是数据
//        String bar1Zpl = "^FO130,100^BY2,50^BY4,3.0,190^BCN,,Y,N,N^FD${data}^FS";//条码样式模板(大)
        String bar1Zpl = "^FX Top section with logo, name and address.\n" +
                "^CF0,60\n" +
                "^FO50,50^GB100,100,100^FS\n" +
                "^FO75,75^FR^GB100,100,100^FS\n" +
                "^FO93,93^GB40,40,40^FS\n" +
                "^FO220,50^FDIntershipping,比亚迪 Inc.^FS\n" +
                "^CF0,30\n" +
                "^FO220,115^FD1000 Shipping Lane^FS\n" +
                "^FO220,155^FDShelbyville TN 38102^FS\n" +
                "^FO220,195^FDUnited States (USA)^FS\n" +
                "^FO50,250^GB700,3,3^FS\n" +
                "\n" +
                "^FX Second section with recipient address and permit information.\n" +
                "^CFA,30\n" +
                "^FO50,300^FDJohn Doe^FS\n" +
                "^FO50,340^FD100 Main Street^FS\n" +
                "^FO50,380^FDSpringfield TN 39021^FS\n" +
                "^FO50,420^FDUnited States (USA)^FS\n" +
                "^CFA,15\n" +
                "^FO600,300^GB150,150,3^FS\n" +
                "^FO638,340^FDPermit^FS\n" +
                "^FO638,390^FD123456^FS\n" +
                "^FO50,500^GB700,3,3^FS\n" +
                "\n" +
                "^FX Third section with bar code.\n" +
                "^BY5,2,270\n" +
                "^FO100,550^BC^FD1234567899^FS\n" +
                "\n" +
                "^FX Fourth section (the two boxes on the bottom).\n" +
                "^FO50,900^GB700,250,3^FS\n" +
                "^FO400,900^GB3,250,3^FS\n" +
                "^CF0,40\n" +
                "^FO100,960^FDCtr. X34B-1^FS\n" +
                "^FO100,1010^FDREF1 F00B47^FS\n" +
                "^FO100,1060^FDREF2 BL4H8^FS\n" +
                "^CF0,190\n" +
                "^FO470,955^FDCA^FS";//条码样式模板(小)
 
//        p.setBarcode(bar1, bar1Zpl);
        p.setText("比亚迪",100,200,30,40,50,60,70,80);
        String zpl = p.getZpl();
        return p.print(zpl);
    }
 
}