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); } }